1

I have image map of one state, where I would like to put about 100 markers. Is it possible to use only one image map instead of CloudMade tiles Leaflet usually uses? So, I need only that image to be shown and markers on that image. I need zooming functionality and marker clustering (leaflet clustering if it's possible). These are pretty all functions I need. Can someone help me, which libraries or APIs are the best way to develop that kind of map?

Thanks.

2 Answers 2

3

It is possible to use a single state as the basemap in leaflet. You need at host the wms service and add it in like any other wms service with "L.tileLayer.wms"

Is this an example of what you want to do: http://www.geocalendar.ru/ The developer for this site can be found on Twitter with the handle @nextstopsun. He takes advantage of the Proj4Leaflet project hosted on github. If you are trying to show your data in a non-standard projection I suggest digging through that.

For your points layers - you can add them as WMS features, GeoJSON, etc. If you want to enter the coordinates in manually (assuming you have the coordinates for your points in wgs84) you can use the Marker object fin leaflet's API documentation.

Here is a great starter example leaflet put together that you could hack up and replace their baselayers with your state basemap wms service, and their markers with your markers. http://leafletjs.com/examples/layers-control-example.html

Up front if you can get your data (wms state basemap and point coordinates) into WGS84 (4326) it would make things a lot easier.

0

If you want to zoom the map then you are better off sticking with tiles instead of a static picture, tiles are used for a reason and they let you zoom in much easier.

If it is a picture you have that you want to display then you can tile it using TileMill and then use mbutil if you just want to host it statically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.