I think it’s fair to say that Google Maps is responsible for pushing the adoption of drag and drop map functionality on the web. Although a number of sites did implemented the behavior before Google, it took off after Maps became more commonly used.
Building out something like this yourself can be challenging – event handlers for mousedown, mouseup, and dragging aren’t terrible but handling speed, zoom, loading, and so on require a bit more work.
That’s why I found SpryMap so convenient.
SpryMap is a JavaScript widget that makes it easy to implement drag and drop behavior much like Google Maps.
SpryMap is a standalone script – it doesn’t require any JavaScript library – and, as such, is extremely lightweight (2.8KB!). The plugin supports options for start and end coordinates as well as options for handling edge cases related to dragging.
Check out the demo and the homepage for more information.
Speak your mind...