JRHutson / Food-Resource-Map

Map of Food Pantries supported by the LA Regional Food Bank
http://jrhutson.github.io/Food-Resource-Map/
3 stars 4 forks source link

Different Initial Extent on Different devices. #33

Closed JRHutson closed 9 years ago

JRHutson commented 9 years ago

The code below seems to set the extent based on making all features in a layer visible. This could allow the initial extent to adjust dynamically on desktop vs. mobile.

var group = new L.featureGroup([marker1, marker2, marker3]);

map.fitBounds(group.getBounds());

Source: http://gis.stackexchange.com/questions/76113/dynamically-set-zoom-level-based-on-a-bounding-box

JRHutson commented 9 years ago

Try this method from Leaflet. http://leafletjs.com/reference.html#latlng

image

JRHutson commented 9 years ago

Issue was comma between coordinates. Seems fixed now. Will sync to gh-pages to test on mobile.

JRHutson commented 9 years ago

Working on both Desktop and Mobile. Will sync to Master.