leaflet-rastercoords | Leaflet plugin for plain image map projection | Map library
kandi X-RAY | leaflet-rastercoords Summary
kandi X-RAY | leaflet-rastercoords Summary
Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- builds the layer in the map
leaflet-rastercoords Key Features
leaflet-rastercoords Examples and Code Snippets
Community Discussions
Trending Discussions on leaflet-rastercoords
QUESTION
Suppose I have a non-geographic image instead of a usual map. Let's say for example an x-ray, MRI scan or microscope image and I would like to use leaflet so I could zoom-in, zoom-out and put some markers on some predetermined points.
I have read the example from Non-geographical maps but this case demonstrates the use of one single image instead of tiling. I would rather prefer tiles since my image is going to be fairly large. Is there something else that would fit a case like the one I described above please? I am looking into rastercoords but I haven't crystallized yet whether this works for any raster file of this is only for plain maps.
...ANSWER
Answered 2018-Jul-15 at 09:48Here's my experience on how to create slippy maps from sources like PDFs or high-res images or non-slippy maps. I wanted to write an article on this anyway, so let this answer be a sketch of the yet-to-be-written article.
To give you an example, here's a PDF map of European inland waterways with vector graphics and here's a slippy map of it.
Basically, the most reasonable way is to make a standard tile set and let Leaflet show it. I.e. to produce tiles sized 256x256 for each of the zoom levels.
You don't want huge images as layers as that will be to heavy for the browser. You also don't want any resizing in the browser, this will lead to poor quality.
Fortunately, creating tiles is quite easy with ImageMagick. This is how I do it.
Decide How Many Zoom Levels You WantFirst, decide how many zoom levels you want. This depends on the map, from my experience you need 5-7 zoom levels at most. Let's take 5 zoom levels for example. The more levels you produce, the higher hardware requirements you will have. The approache below is probably not suitable for more that 7-8 zoom levels.
Render or Resize the Source ImageNext, render or resize your image for each of the zoom levels. You have to produce images with one of the dimensions equal to:
256
pixel on level 0512
pixel on level 11024
pixel on level 22048
pixel on level 34096
pixel on level 4- and so on.
Attention: the result of this step are huge images. Level 5 would be around 10 MB, level 6 around 20 MB, level 7 around 40 MB. Be careful try to open these images in "normal" tools.
Resizing a Normal High-Res ImageIf your source is a high-res image simply use convert -resize
with either x*256*
or *256*x
:
QUESTION
I am developing an Angular web application, where i have few tabs (tabs are created using material-angular).
On selection of each tab, i want to show a different map. I am using leaflet and leaflet-rastercoords angular plugins to display custom maps.
I am able to display a single map on the first tab, However, when ti try to display maps on other tabs, i get various errors while i try different ways -
Strategies I have tried but didn't work -
- Separate component for each map
- Separate map initialization in different functions
Please guide me a suitable way or a useful plugin, that would make my life easy.
TIA
...ANSWER
Answered 2019-Nov-01 at 07:05When you say a different map on a different tab, I understand that a different location on each tab. To achieve it, you need to give the different feed(input) to each map(latitude /longitude). Here is an example:
QUESTION
I'm looking to get something like this.
I've spent a week trying to find a solution to no avail. I am looking for library that can work with React.
The image should not stretch or lose quality when browser is minimised, i should be able to drag/pinch along.
Any advise welcome.
...ANSWER
Answered 2018-Jan-15 at 07:54You should check React Leaflet. You can build pretty much anything map-related with it.
QUESTION
I'm building a story map with Leaflet using a large image sliced into tiles rather than 'real world' map data. I'm using this plugin: https://commenthol.github.io/leaflet-rastercoords/ and this repo: https://github.com/jackdougherty/leaflet-storymap
Loading my GeoJSON data and unprojecting the coordinates correctly plots them on my image map:
...ANSWER
Answered 2017-May-19 at 06:56In your case you would probably just need to use rc.unproject
to convert your coordinates into LatLng that you can pass to flyTo
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install leaflet-rastercoords
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page