[GIS] How to use Leaflet marker clustering with image map only

clusteringjavascriptleafletweb-mapping

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.

Best Answer

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.