@the-grid/ed-location
Advanced tools
Comparing version 2.0.0 to 2.0.1
document.addEventListener('DOMContentLoaded', function () { | ||
var DEFAULT_LAT = 20 | ||
var DEFAULT_LON = -35 | ||
L.mapbox.accessToken = 'pk.eyJ1IjoiZm9ycmVzdG8iLCJhIjoiY2lwOGtmN2s0MDE4dXRqbm91eWIzbzhqZiJ9.ythDls7OnKQKEPL6iq5p8Q' | ||
@@ -72,3 +75,3 @@ | ||
, 'mapbox.streets' | ||
, { center: [20, -35] | ||
, { center: [DEFAULT_LAT, DEFAULT_LON] | ||
, zoom: 2 | ||
@@ -81,6 +84,12 @@ , scrollWheelZoom: false | ||
.addEventListener('zoomend', function (event) { | ||
// This is triggered by edToLocation zoom changes, | ||
// so we have to avoid sending default lat / lon | ||
var loc = marker.getLatLng() | ||
if (loc.lat === DEFAULT_LAT && loc.lng === DEFAULT_LON) { | ||
return | ||
} | ||
locationToEd() | ||
}) | ||
var marker = L.marker([20, -35] | ||
var marker = L.marker([DEFAULT_LAT, DEFAULT_LON] | ||
, { icon: L.mapbox.marker.icon({'marker-color': 'ff8888'}) | ||
@@ -87,0 +96,0 @@ , draggable: true |
{ | ||
"name": "@the-grid/ed-location", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Ed widget for address geocoding and map location editing", | ||
@@ -5,0 +5,0 @@ "main": "ed-location.js", |
Sorry, the diff of this file is not supported yet
11765
154