New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

poly-js-utils

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poly-js-utils - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

package.json
{
"name": "poly-js-utils",
"version": "1.1.3",
"version": "1.1.4",
"description": "Common client-side tools used in HSS Sites themes and locators.",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -15,2 +15,5 @@ /******************/

var googleGeocodeAddress = function(address, callback) {
if(typeof google !== 'object' || typeof google.maps !== 'object') {
callback(false, "Unable to load Google API script.");
}
var geocoder = new google.maps.Geocoder();

@@ -38,36 +41,38 @@ var string = address;

var showGoogleMap = function(latlng, containerID, useDefaultMarker, options) {
latlng = latlng || [];
useDefaultMarker = useDefaultMarker === undefined ? true : useDefaultMarker;
var defaults = {
zoom: DEFAULT_ZOOM_LEVEL,
mapTypeControl: false,
scrollwheel: false,
disableDefaultUI: false,
disableDoubleClickZoom: false,
draggable: true
};
options = _.extend(defaults, options);
// Set center, defaulting to empty gmaps LatLng object.
options.center = latlng.length ?
{lat: latlng[0], lng: latlng[1]} : new google.maps.LatLng();
if(typeof google === 'object' && typeof google.maps === 'object') {
latlng = latlng || [];
useDefaultMarker = useDefaultMarker === undefined ? true : useDefaultMarker;
var defaults = {
zoom: DEFAULT_ZOOM_LEVEL,
mapTypeControl: false,
scrollwheel: false,
disableDefaultUI: false,
disableDoubleClickZoom: false,
draggable: true
};
options = _.extend(defaults, options);
// Set center, defaulting to empty gmaps LatLng object.
options.center = latlng.length ?
{lat: latlng[0], lng: latlng[1]} : new google.maps.LatLng();
// Only have one map per container.
var map = _googleMaps[containerID];
if (!map) {
map = new google.maps.Map(document.getElementById(containerID), options);
_googleMaps[containerID] = map;
} else {
// Force a resize so that we don't see missing tiles
google.maps.event.trigger(map, "resize");
}
map.setOptions(options);
// Only have one map per container.
var map = _googleMaps[containerID];
if (!map) {
map = new google.maps.Map(document.getElementById(containerID), options);
_googleMaps[containerID] = map;
} else {
// Force a resize so that we don't see missing tiles
google.maps.event.trigger(map, "resize");
}
map.setOptions(options);
// Don't show default marker if we don't have a latlng to place it at.
if (useDefaultMarker && latlng) {
new google.maps.Marker({
position: options.center,
map: map
});
// Don't show default marker if we don't have a latlng to place it at.
if (useDefaultMarker && latlng) {
new google.maps.Marker({
position: options.center,
map: map
});
}
return map;
}
return map;
};

@@ -74,0 +79,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc