radius-widget
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "radius-widget", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Uses Google maps API to set location and radius", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -21,2 +21,3 @@ (function() { | ||
radiusWidget.ignore = true; | ||
radiusWidget.cityCircle.setCenter(centerPoint); | ||
@@ -75,6 +76,6 @@ radiusWidget.container.querySelector('input[name=lat]').value = centerPoint.lat; | ||
function showMap(radiusWidget) { | ||
function showMap(radiusWidget, center, zoom) { | ||
let mconfig = { | ||
zoom: radiusWidget.config.initialZoom, | ||
center: radiusWidget.config.initialCenter, | ||
zoom: zoom || radiusWidget.config.initialZoom, | ||
center: center || radiusWidget.config.initialCenter, | ||
zoomControl: true, | ||
@@ -91,3 +92,4 @@ mapTypeControl: false, | ||
); | ||
radiusWidget.map.panTo(radiusWidget.config.initialCenter); | ||
// ToDo: remove panTo, because of map already initialized with initialCenter parameter in previous command | ||
//radiusWidget.map.panTo(radiusWidget.config.initialCenter); | ||
} | ||
@@ -103,5 +105,5 @@ | ||
var centerPoint = {lat: results[0].geometry.location.lat(), lng :results[0].geometry.location.lng()}; | ||
var zoom = Math.max(3, Math.min(16, Math.ceil(radiusWidget.config.cityLevelZoom + 1/Math.log(2)))); | ||
var zoom = Math.max(3, Math.min(16, Math.ceil(radiusWidget.config.cityLevelZoom))); | ||
if (radiusWidget.map == null) { | ||
showMap(radiusWidget); | ||
showMap(radiusWidget, centerPoint, zoom); | ||
} else { | ||
@@ -146,4 +148,4 @@ radiusWidget.map.setZoom(zoom); | ||
google.maps.event.addListener(radiusWidget.cityCircle, "center_changed", function(){ | ||
if (this.ignore){ | ||
this.ignore = false; | ||
if (radiusWidget.ignore){ | ||
radiusWidget.ignore = false; | ||
return; | ||
@@ -189,3 +191,3 @@ } | ||
this.container.querySelector('div.rw-map-container').style.width = '100%'; | ||
this.container.querySelector('div.rw-form-container').style.visibility = 'hidden'; | ||
this.container.querySelector('div.rw-form-container').style.display = 'none'; | ||
} | ||
@@ -192,0 +194,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14920
238
0