alfarisi / leaflet-deepzoom

Display DeepZoom tiles with Leaflet
http://www.indokreatif.net
25 stars 15 forks source link

Set the view of the map and add a marker #4

Open Risengan opened 6 years ago

Risengan commented 6 years ago

I can't set the view of the map with L.LatLng : var map = L.map('map', {}).setView(new L.LatLng(0,0), 0);

Same with the markers, I can't create one. It's normal?

Thanks!

glenngr commented 6 years ago

Try looking into the map.unproject() function. It takes a point (pixels on your map) and translates it to a LatLng. Example where max zoom level is 4:

var position = map.unproject(L.point(0, 0), 4);
L.circle(position, {radius: 1}).addTo(map);