Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wp-map-picker

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wp-map-picker - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

2

bower.json
{
"name": "wp-map-picker",
"version": "0.7.0",
"version": "0.7.1",
"description": "This jQuery plugin for WordPress can be used to transform an input field into a flexible map field with a location picker.",

@@ -5,0 +5,0 @@ "main": [

{
"name": "wp-map-picker",
"version": "0.7.0",
"version": "0.7.1",
"description": "This jQuery plugin for WordPress can be used to transform an input field into a flexible map field with a location picker.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -32,4 +32,4 @@ # WP Map Picker

wp_enqueue_script( 'google-maps', $gmaps_url, array(), false, true );
wp_enqueue_script( 'wp-map-picker', 'PATHTOMAPPICKER/wp-map-picker.min.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-autocomplete', 'google-maps' ), '0.7.0', true );
wp_enqueue_style( 'wp-map-picker', 'PATHTOMAPPICKER/wp-map-picker.min.css', array(), '0.7.0' );
wp_enqueue_script( 'wp-map-picker', 'PATHTOMAPPICKER/wp-map-picker.min.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-autocomplete', 'google-maps' ), '0.7.1', true );
wp_enqueue_style( 'wp-map-picker', 'PATHTOMAPPICKER/wp-map-picker.min.css', array(), '0.7.1' );

@@ -36,0 +36,0 @@ ```

/*
* WP Map Picker - version 0.7.0
* WP Map Picker - version 0.7.1
*

@@ -15,3 +15,3 @@ * Felix Arntz <felix-arntz@leaves-and-love.net>

console.error( 'Google Maps not found' );
console.error( 'Google Maps API not found' );
return;

@@ -308,2 +308,2 @@ }

$.widget( 'wp.wpMapPicker', MapPicker );
}( jQuery, google ) );
}( jQuery, window.google ) );
/*!
* WP Map Picker - version 0.7.0
* WP Map Picker - version 0.7.1
*
* Felix Arntz <felix-arntz@leaves-and-love.net>
*/
!function(a,b){if(void 0===b||void 0===b.maps)return a.fn.wpMapPicker=function(){return this},void console.error("Google Maps not found");var c='<div class="wp-mappicker-container" />',d='<div class="wp-mappicker-map-canvas-wrap" />',e='<div class="wp-mappicker-map-canvas" />',f={options:{store:"address",storeAdditional:!1,zoom:15,draggable:!0,mapType:"roadmap",defaultLocation:{lat:"0.0",lng:"0.0",zoom:2},decimalSeparator:".",change:!1,clear:!1},_create:function(){var f=this;a.extend(f.options,f.element.data()),f.defaultLatLng=f._parseLatLng(f.options.defaultLocation),f.is_default=!0,f.element.wrap(c),f.canvas_wrap=a(d).insertAfter(f.element),f.canvas=a(e).appendTo(f.canvas_wrap),f.geocoder=new b.maps.Geocoder,f.map=new b.maps.Map(f.canvas[0],{center:f.defaultLatLng,zoom:f.options.defaultLocation.zoom,draggable:f.options.draggable,tilt:0,streetViewControl:0,mapTypeId:b.maps.MapTypeId[f.options.mapType.toUpperCase()]}),f.marker=new b.maps.Marker({position:f.defaultLatLng,map:f.map,draggable:!0});var g=f.element.val();"coords"===f.options.store?f._geocodeLatLng(g,f._initMap):f._geocodeAddress(g,f._initMap),"coords"===f.options.store?f.element.on("change",function(){f._geocodeLatLng(f.element.val(),f._updateMap)}):f.element.autocomplete({source:function(a,b){f._geocodeAddress(a.term,function(a){b(a?[{label:a.formatted_address,value:a.formatted_address,latlng:a.geometry.location,geocoded:a}]:[])})},select:function(a,b){f._updateMap(b.item.geocoded)}}),b.maps.event.addListener(f.map,"click",function(a){f._geocodeLatLng(a.latLng,f._updateField)}),b.maps.event.addListener(f.marker,"dragend",function(a){f._geocodeLatLng(a.latLng,f._updateField)})},_initMap:function(a){a?(this.latlng=a.geometry.location,this.marker.setPosition(this.latlng),this.map.setCenter(this.latlng),this.is_default&&(this.is_default=!1,this.map.setZoom(this.options.zoom))):(this.latlng=null,this.marker.setPosition(this.defaultLatLng),this.map.setCenter(this.defaultLatLng),this.is_default||(this.is_default=!0,this.map.setZoom(this.options.defaultLocation.zoom)))},_updateMap:function(b){this._initMap(b),this.options.storeAdditional&&this._updateAdditionalFields(b),"function"==typeof this.options.change&&this.options.change.call(this),a(document).trigger("wpMapPicker.updateMap",[b,this])},_updateField:function(b){b?(this.latlng=b.geometry.location,"coords"===this.options.store?this.element.val(this._formatLatLng(b.geometry.location)):this.element.val(b.formatted_address)):(this.latlng=null,this.element.val(null)),this.options.storeAdditional&&this._updateAdditionalFields(b),"function"==typeof this.options.change&&this.options.change.call(this),a(document).trigger("wpMapPicker.updateField",[b,this])},_updateAdditionalFields:function(b){var c,d,e,f,g=Object.keys(this.options.storeAdditional);for(var h in g){if(d=g[h],c=this.options.storeAdditional[d],f=a(d).val(),e=null,b)switch(c){case"coords":e=this._formatLatLng(b.geometry.location);break;case"address":e=b.formatted_address;break;case"latitude":e=this._formatLatOrLng(b.geometry.location.lat());break;case"longitude":e=this._formatLatOrLng(b.geometry.location.lng());break;default:void 0!==b[c]&&(e=b[c])}e!==f&&a(d).val(e).trigger("change")}},_geocodeLatLng:function(a,b){if(!a)return void b.apply(this,[a]);this._geocodeObject({location:this._parseLatLng(a)},b)},_geocodeAddress:function(a,b){if(!a)return void b.apply(this,[a]);this._geocodeObject({address:a},b)},_geocodeObject:function(a,b){var c=this;c.geocoder.geocode(a,function(a){var d;null!==a&&void 0!==a[0]&&(d=a[0]),b.apply(c,[d])})},_parseLatLng:function(a){if("object"==typeof a&&"function"!=typeof a.lat)a=a.lat+"|"+a.lng;else if("object"==typeof a)return a;if("string"!=typeof a)return!1;if(a=a.split("|"),2!==a.length)return!1;for(var c=0;c<2;c++)a[c]=this._parseLatOrLng(a[c]);return new b.maps.LatLng(a[0],a[1])},_parseLatOrLng:function(a){return parseFloat(a.replace(this.options.decimalSeparator,"."))},_formatLatLng:function(a){return"string"==typeof a?a:this._formatLatOrLng(a.lat())+"|"+this._formatLatOrLng(a.lng())},_formatLatOrLng:function(a){return(""+a).replace(".",this.options.decimalSeparator)},clear:function(){this._initMap(),this._updateField(),"function"==typeof this.options.clear&&this.options.clear.call(this)},refresh:function(){b.maps.event.trigger(this.map,"resize"),this.latlng?this.map.setCenter(this.latlng):this.map.setCenter(this.defaultLatLng)}};a.widget("wp.wpMapPicker",f)}(jQuery,google);
!function(a,b){if(void 0===b||void 0===b.maps)return a.fn.wpMapPicker=function(){return this},void console.error("Google Maps API not found");var c='<div class="wp-mappicker-container" />',d='<div class="wp-mappicker-map-canvas-wrap" />',e='<div class="wp-mappicker-map-canvas" />',f={options:{store:"address",storeAdditional:!1,zoom:15,draggable:!0,mapType:"roadmap",defaultLocation:{lat:"0.0",lng:"0.0",zoom:2},decimalSeparator:".",change:!1,clear:!1},_create:function(){var f=this;a.extend(f.options,f.element.data()),f.defaultLatLng=f._parseLatLng(f.options.defaultLocation),f.is_default=!0,f.element.wrap(c),f.canvas_wrap=a(d).insertAfter(f.element),f.canvas=a(e).appendTo(f.canvas_wrap),f.geocoder=new b.maps.Geocoder,f.map=new b.maps.Map(f.canvas[0],{center:f.defaultLatLng,zoom:f.options.defaultLocation.zoom,draggable:f.options.draggable,tilt:0,streetViewControl:0,mapTypeId:b.maps.MapTypeId[f.options.mapType.toUpperCase()]}),f.marker=new b.maps.Marker({position:f.defaultLatLng,map:f.map,draggable:!0});var g=f.element.val();"coords"===f.options.store?f._geocodeLatLng(g,f._initMap):f._geocodeAddress(g,f._initMap),"coords"===f.options.store?f.element.on("change",function(){f._geocodeLatLng(f.element.val(),f._updateMap)}):f.element.autocomplete({source:function(a,b){f._geocodeAddress(a.term,function(a){b(a?[{label:a.formatted_address,value:a.formatted_address,latlng:a.geometry.location,geocoded:a}]:[])})},select:function(a,b){f._updateMap(b.item.geocoded)}}),b.maps.event.addListener(f.map,"click",function(a){f._geocodeLatLng(a.latLng,f._updateField)}),b.maps.event.addListener(f.marker,"dragend",function(a){f._geocodeLatLng(a.latLng,f._updateField)})},_initMap:function(a){a?(this.latlng=a.geometry.location,this.marker.setPosition(this.latlng),this.map.setCenter(this.latlng),this.is_default&&(this.is_default=!1,this.map.setZoom(this.options.zoom))):(this.latlng=null,this.marker.setPosition(this.defaultLatLng),this.map.setCenter(this.defaultLatLng),this.is_default||(this.is_default=!0,this.map.setZoom(this.options.defaultLocation.zoom)))},_updateMap:function(b){this._initMap(b),this.options.storeAdditional&&this._updateAdditionalFields(b),"function"==typeof this.options.change&&this.options.change.call(this),a(document).trigger("wpMapPicker.updateMap",[b,this])},_updateField:function(b){b?(this.latlng=b.geometry.location,"coords"===this.options.store?this.element.val(this._formatLatLng(b.geometry.location)):this.element.val(b.formatted_address)):(this.latlng=null,this.element.val(null)),this.options.storeAdditional&&this._updateAdditionalFields(b),"function"==typeof this.options.change&&this.options.change.call(this),a(document).trigger("wpMapPicker.updateField",[b,this])},_updateAdditionalFields:function(b){var c,d,e,f,g=Object.keys(this.options.storeAdditional);for(var h in g){if(d=g[h],c=this.options.storeAdditional[d],f=a(d).val(),e=null,b)switch(c){case"coords":e=this._formatLatLng(b.geometry.location);break;case"address":e=b.formatted_address;break;case"latitude":e=this._formatLatOrLng(b.geometry.location.lat());break;case"longitude":e=this._formatLatOrLng(b.geometry.location.lng());break;default:void 0!==b[c]&&(e=b[c])}e!==f&&a(d).val(e).trigger("change")}},_geocodeLatLng:function(a,b){if(!a)return void b.apply(this,[a]);this._geocodeObject({location:this._parseLatLng(a)},b)},_geocodeAddress:function(a,b){if(!a)return void b.apply(this,[a]);this._geocodeObject({address:a},b)},_geocodeObject:function(a,b){var c=this;c.geocoder.geocode(a,function(a){var d;null!==a&&void 0!==a[0]&&(d=a[0]),b.apply(c,[d])})},_parseLatLng:function(a){if("object"==typeof a&&"function"!=typeof a.lat)a=a.lat+"|"+a.lng;else if("object"==typeof a)return a;if("string"!=typeof a)return!1;if(a=a.split("|"),2!==a.length)return!1;for(var c=0;c<2;c++)a[c]=this._parseLatOrLng(a[c]);return new b.maps.LatLng(a[0],a[1])},_parseLatOrLng:function(a){return parseFloat(a.replace(this.options.decimalSeparator,"."))},_formatLatLng:function(a){return"string"==typeof a?a:this._formatLatOrLng(a.lat())+"|"+this._formatLatOrLng(a.lng())},_formatLatOrLng:function(a){return(""+a).replace(".",this.options.decimalSeparator)},clear:function(){this._initMap(),this._updateField(),"function"==typeof this.options.clear&&this.options.clear.call(this)},refresh:function(){b.maps.event.trigger(this.map,"resize"),this.latlng?this.map.setCenter(this.latlng):this.map.setCenter(this.defaultLatLng)}};a.widget("wp.wpMapPicker",f)}(jQuery,window.google);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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