Live data from Hacker News

Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

leafletjs.com

1–10 of 78 posts

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#2
Works quite well (on iOS), really good work! Here is a small issue I experience on a lot of mobile sites with embedded maps and also on yours:

If I zoom the page outside of the map and then scroll so that the map fills the full screen there is no way to zoom out/get away from the map again. You will just scroll and zoom the map and eventually will have to reload the page. It also allows to scroll far out of bounds of the world which can be a bit confusing.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#3
post #2

Works quite well (on iOS), really good work! Here is a small issue I experience on a lot of mobile sites with embedded maps and also on yours: If I zoom the page outside of the map and then scroll so that the map fills the full screen there is no way to zoom out/get away from the map again. You will just scroll and zoom the map and eventually will have to reload the page. It also allows to scroll far out of bounds of…

This is a problem I've noticed with a number of mobile-friendly sites that offer a full width map, regardless of how it is implemented. However recently, there have been a number of occasions where embedded Google Maps instances have insisted (on iOS) the use of two fingers to scroll, helping solve the issues of being stranded within a map.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#4
post #2

Works quite well (on iOS), really good work! Here is a small issue I experience on a lot of mobile sites with embedded maps and also on yours: If I zoom the page outside of the map and then scroll so that the map fills the full screen there is no way to zoom out/get away from the map again. You will just scroll and zoom the map and eventually will have to reload the page. It also allows to scroll far out of bounds of…

This happens with other UI elements as well like those instructive subscribe pop ups.

I'm not up to speed with the latest JS and browser features, but unless there is some sort of zoom reset from the browser itself I don't think there is an easy solution without making arbitrary decisions like "user has scrolled up 10 times, move entire page up"

For instance , if I shake my mobile (think google maps) or 3 finger Zoom out, then the browser resets the zoom level.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#8

Doesn't work at all on desktop with blocked Twitter / Google

Do you mean the leaflet website, or the leaflet maps library itself?

I see the http://leafletjs.com website uses some google fonts, and google analytics, but I would have thought it would degrade gracefully if those things are blocked.

As for the leaflet maps library itself, this will definitely operate independently of google or twitter. Try here for a simple example embedded on my website (with no googleness) http://harrywood.co.uk/maps/examples/leaflet/1-just-map.view... or even better, try here where I'm loading it from locally hosted javascript: http://harrywood.co.uk/maps/examples/leaflet/1b-local-osm.vi...

Those links working for you?

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#9

Doesn't work at all on desktop with blocked Twitter / Google

You are likely blocking something else, possibly unpkg.com, which is the CDN the demo page loads the lib from. Blocking all Twitter/Facebook/Google domains the page still works for me.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#10
LeafletJS is awesome. It's an important open source offering within the OpenStreetMap ecosystem. If you're looking for an "OpenStreetMap API" for embedding a map, then you're looking for LeafletJS! ...or another one called OpenLayers, or various other lesser used options. You have a choice! With OpenStreetMap you also have a choice of where you get your map "tiles" from, or you can render and host them yourself. Check out this website which explains a lot more about the various options for making the switch to OpenStreetMap:

http://switch2osm.org

Post reply on HN