alfarisi / leaflet-deepzoom

Display DeepZoom tiles with Leaflet

Home Page:http://www.indokreatif.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set the view of the map and add a marker

Risengan opened this issue · comments

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!

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);