From 57caed9fa3dd777355299edd99d1cf59e6b1c7b1 Mon Sep 17 00:00:00 2001 From: EmanueleCoppola Date: Fri, 11 Mar 2016 01:17:39 +0100 Subject: [PATCH 1/4] Added custom icon functionality, modified examples and updated version. --- README.md | 2 + bower.json | 2 +- dist/locationpicker.jquery.js | 61 +++- dist/locationpicker.jquery.min.js | 6 +- dist/locationpicker.jquery.min.js.map | 1 + dist/locationpicker.jquery.min.map | 1 - examples/examples.html | 407 ++++++++++++++------------ examples/mapInModalDialog.html | 125 ++++---- examples/simple.html | 82 +++--- locationpicker.jquery.json | 8 +- package.json | 4 +- src/locationpicker.jquery.js | 18 +- 12 files changed, 422 insertions(+), 295 deletions(-) create mode 100644 dist/locationpicker.jquery.min.js.map delete mode 100644 dist/locationpicker.jquery.min.map diff --git a/README.md b/README.md index 35eae20..5c7daf9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ The plug-in requires [jQuery](http://jquery.com/) and the [Google Maps API](http * Add jQuery and Google Maps API to the `` of your HTML file: ``` +// be careful to include the parameter "libraries=places" ``` @@ -40,3 +41,4 @@ Documentation along with examples available [here](http://logicify.github.io/jqu Credits ------- Dmitry Berezovsky, Logicify () +Emanuele Coppola, Libre sc () diff --git a/bower.json b/bower.json index 0f70ce9..352913f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-locationpicker", - "version": "0.1.12", + "version": "0.1.13", "homepage": "https://github.com/Logicify/jquery-locationpicker-plugin", "authors": [ "Dmitry Berezovsky " diff --git a/dist/locationpicker.jquery.js b/dist/locationpicker.jquery.js index bb1dff7..6727da0 100644 --- a/dist/locationpicker.jquery.js +++ b/dist/locationpicker.jquery.js @@ -1,4 +1,4 @@ -/*! jquery-locationpicker - v0.1.12 - 2015-01-05 */ +/*! jquery-locationpicker - v0.1.13 - 2016-03-11 */ (function($) { function GMapContext(domElement, options) { var _map = new google.maps.Map(domElement, options); @@ -6,7 +6,8 @@ position: new google.maps.LatLng(54.19335, -3.92695), map: _map, title: "Drag Me", - draggable: options.draggable + draggable: options.draggable, + icon: options.markerIcon !== undefined ? options.markerIcon : undefined }); return { map: _map, @@ -143,8 +144,10 @@ }); } if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) { + var blur = false; gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0)); google.maps.event.addListener(gmapContext.autocomplete, "place_changed", function() { + blur = false; var place = gmapContext.autocomplete.getPlace(); if (!place.geometry) { gmapContext.settings.onlocationnotfound(place.name); @@ -155,6 +158,35 @@ context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); }); }); + if (gmapContext.settings.enableAutocompleteBlur) { + inputBinding.locationNameInput.on("change", function(e) { + if (!e.originalEvent) { + return; + } + blur = true; + }); + inputBinding.locationNameInput.on("blur", function(e) { + if (!e.originalEvent) { + return; + } + setTimeout(function() { + var address = $(inputBinding.locationNameInput).val(); + if (address.length > 5 && blur) { + blur = false; + gmapContext.geodecoder.geocode({ + address: address + }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK && results && results.length) { + GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) { + updateInputValues(inputBinding, context); + context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); + }); + } + }); + } + }, 1e3); + }); + } } if (inputBinding.latitudeInput) { inputBinding.latitudeInput.on("change", function(e) { @@ -184,6 +216,17 @@ gmapContext.map.setCenter(gmapContext.marker.position); }, 300); } + function updateMap(gmapContext, $target, options) { + var settings = $.extend({}, $.fn.locationpicker.defaults, options), latNew = settings.location.latitude, lngNew = settings.location.longitude, radiusNew = settings.radius, latOld = gmapContext.settings.location.latitude, lngOld = gmapContext.settings.location.longitude, radiusOld = gmapContext.settings.radius; + if (latNew == latOld && lngNew == lngOld && radiusNew == radiusOld) return; + gmapContext.settings.location.latitude = latNew; + gmapContext.settings.location.longitude = lngNew; + gmapContext.radius = radiusNew; + GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.settings.location.latitude, gmapContext.settings.location.longitude), function(context) { + setupInputListenersInput(gmapContext.settings.inputBinding, gmapContext); + context.settings.oninitialized($target); + }); + } $.fn.locationpicker = function(options, params) { if (typeof options == "string") { var _targetDomElement = this.get(0); @@ -242,7 +285,10 @@ } return this.each(function() { var $target = $(this); - if (isPluginApplied(this)) return; + if (isPluginApplied(this)) { + updateMap(getContextForElement(this), $(this), options); + return; + } var settings = $.extend({}, $.fn.locationpicker.defaults, options); var gmapContext = new GMapContext(this, { zoom: settings.zoom, @@ -255,7 +301,8 @@ radius: settings.radius, locationName: settings.locationName, settings: settings, - draggable: settings.draggable + draggable: settings.draggable, + markerIcon: settings.markerIcon }); $target.data("locationpicker", gmapContext); google.maps.event.addListener(gmapContext.marker, "dragend", function(event) { @@ -275,7 +322,7 @@ $.fn.locationpicker.defaults = { location: { latitude: 40.7324319, - longitude: -73.82480799999996 + longitude: -73.82480777777776 }, locationName: "", radius: 500, @@ -288,10 +335,12 @@ locationNameInput: null }, enableAutocomplete: false, + enableAutocompleteBlur: false, enableReverseGeocode: true, draggable: true, onchanged: function(currentLocation, radius, isMarkerDropped) {}, onlocationnotfound: function(locationName) {}, - oninitialized: function(component) {} + oninitialized: function(component) {}, + markerIcon: undefined }; })(jQuery); \ No newline at end of file diff --git a/dist/locationpicker.jquery.min.js b/dist/locationpicker.jquery.min.js index 80653b2..4382601 100644 --- a/dist/locationpicker.jquery.min.js +++ b/dist/locationpicker.jquery.min.js @@ -1,4 +1,4 @@ -/*! jquery-locationpicker - v0.1.12 - 2015-01-05 */ +/*! jquery-locationpicker - v0.1.13 - 2016-03-11 */ -!function(a){function b(a,b){var c=new google.maps.Map(a,b),d=new google.maps.Marker({position:new google.maps.LatLng(54.19335,-3.92695),map:c,title:"Drag Me",draggable:b.draggable});return{map:c,marker:d,circle:null,location:d.position,radius:b.radius,locationName:b.locationName,addressComponents:{formatted_address:null,addressLine1:null,addressLine2:null,streetName:null,streetNumber:null,city:null,district:null,state:null,stateOrProvince:null},settings:b.settings,domContainer:a,geodecoder:new google.maps.Geocoder}}function c(a){return void 0!=d(a)}function d(b){return a(b).data("locationpicker")}function e(a,b){if(a){var c=h.locationFromLatLng(b.location);a.latitudeInput&&a.latitudeInput.val(c.latitude).change(),a.longitudeInput&&a.longitudeInput.val(c.longitude).change(),a.radiusInput&&a.radiusInput.val(b.radius).change(),a.locationNameInput&&a.locationNameInput.val(b.locationName).change()}}function f(b,c){b&&(b.radiusInput&&b.radiusInput.on("change",function(b){b.originalEvent&&(c.radius=a(this).val(),h.setPosition(c,c.location,function(a){a.settings.onchanged.apply(c.domContainer,[h.locationFromLatLng(a.location),a.radius,!1])}))}),b.locationNameInput&&c.settings.enableAutocomplete&&(c.autocomplete=new google.maps.places.Autocomplete(b.locationNameInput.get(0)),google.maps.event.addListener(c.autocomplete,"place_changed",function(){var a=c.autocomplete.getPlace();return a.geometry?void h.setPosition(c,a.geometry.location,function(a){e(b,a),a.settings.onchanged.apply(c.domContainer,[h.locationFromLatLng(a.location),a.radius,!1])}):void c.settings.onlocationnotfound(a.name)})),b.latitudeInput&&b.latitudeInput.on("change",function(b){b.originalEvent&&h.setPosition(c,new google.maps.LatLng(a(this).val(),c.location.lng()),function(a){a.settings.onchanged.apply(c.domContainer,[h.locationFromLatLng(a.location),a.radius,!1])})}),b.longitudeInput&&b.longitudeInput.on("change",function(b){b.originalEvent&&h.setPosition(c,new google.maps.LatLng(c.location.lat(),a(this).val()),function(a){a.settings.onchanged.apply(c.domContainer,[h.locationFromLatLng(a.location),a.radius,!1])})}))}function g(a){google.maps.event.trigger(a.map,"resize"),setTimeout(function(){a.map.setCenter(a.marker.position)},300)}var h={drawCircle:function(b,c,d,e){return null!=b.circle&&b.circle.setMap(null),d>0?(d*=1,e=a.extend({strokeColor:"#0000FF",strokeOpacity:.35,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2},e),e.map=b.map,e.radius=d,e.center=c,b.circle=new google.maps.Circle(e),b.circle):null},setPosition:function(a,b,c){a.location=b,a.marker.setPosition(b),a.map.panTo(b),this.drawCircle(a,b,a.radius,{}),a.settings.enableReverseGeocode?a.geodecoder.geocode({latLng:a.location},function(b,d){d==google.maps.GeocoderStatus.OK&&b.length>0&&(a.locationName=b[0].formatted_address,a.addressComponents=h.address_component_from_google_geocode(b[0].address_components)),c&&c.call(this,a)}):c&&c.call(this,a)},locationFromLatLng:function(a){return{latitude:a.lat(),longitude:a.lng()}},address_component_from_google_geocode:function(a){for(var b={},c=a.length-1;c>=0;c--){var d=a[c];d.types.indexOf("postal_code")>=0?b.postalCode=d.short_name:d.types.indexOf("street_number")>=0?b.streetNumber=d.short_name:d.types.indexOf("route")>=0?b.streetName=d.short_name:d.types.indexOf("locality")>=0?b.city=d.short_name:d.types.indexOf("sublocality")>=0?b.district=d.short_name:d.types.indexOf("administrative_area_level_1")>=0?b.stateOrProvince=d.short_name:d.types.indexOf("country")>=0&&(b.country=d.short_name)}return b.addressLine1=[b.streetNumber,b.streetName].join(" ").trim(),b.addressLine2="",b}};a.fn.locationpicker=function(i,j){if("string"==typeof i){var k=this.get(0);if(!c(k))return;var l=d(k);switch(i){case"location":if(void 0==j){var m=h.locationFromLatLng(l.location);return m.radius=l.radius,m.name=l.locationName,m}j.radius&&(l.radius=j.radius),h.setPosition(l,new google.maps.LatLng(j.latitude,j.longitude),function(a){e(a.settings.inputBinding,a)});break;case"subscribe":if(void 0==j)return null;var n=j.event,o=j.callback;if(!n||!o)return console.error('LocationPicker: Invalid arguments for method "subscribe"'),null;google.maps.event.addListener(l.map,n,o);break;case"map":if(void 0==j){var p=h.locationFromLatLng(l.location);return p.formattedAddress=l.locationName,p.addressComponents=l.addressComponents,{map:l.map,marker:l.marker,location:p}}return null;case"autosize":return g(l),this}return null}return this.each(function(){var d=a(this);if(!c(this)){var g=a.extend({},a.fn.locationpicker.defaults,i),j=new b(this,{zoom:g.zoom,center:new google.maps.LatLng(g.location.latitude,g.location.longitude),mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1,disableDoubleClickZoom:!1,scrollwheel:g.scrollwheel,streetViewControl:!1,radius:g.radius,locationName:g.locationName,settings:g,draggable:g.draggable});d.data("locationpicker",j),google.maps.event.addListener(j.marker,"dragend",function(){h.setPosition(j,j.marker.position,function(a){var b=h.locationFromLatLng(j.location);a.settings.onchanged.apply(j.domContainer,[b,a.radius,!0]),e(j.settings.inputBinding,j)})}),h.setPosition(j,new google.maps.LatLng(g.location.latitude,g.location.longitude),function(a){e(g.inputBinding,j),f(g.inputBinding,j),a.settings.oninitialized(d)})}})},a.fn.locationpicker.defaults={location:{latitude:40.7324319,longitude:-73.82480799999996},locationName:"",radius:500,zoom:15,scrollwheel:!0,inputBinding:{latitudeInput:null,longitudeInput:null,radiusInput:null,locationNameInput:null},enableAutocomplete:!1,enableReverseGeocode:!0,draggable:!0,onchanged:function(){},onlocationnotfound:function(){},oninitialized:function(){}}}(jQuery); -//# sourceMappingURL=locationpicker.jquery.min.map \ No newline at end of file +!function(a){function b(a,b){var c=new google.maps.Map(a,b),d=new google.maps.Marker({position:new google.maps.LatLng(54.19335,-3.92695),map:c,title:"Drag Me",draggable:b.draggable,icon:void 0!==b.markerIcon?b.markerIcon:void 0});return{map:c,marker:d,circle:null,location:d.position,radius:b.radius,locationName:b.locationName,addressComponents:{formatted_address:null,addressLine1:null,addressLine2:null,streetName:null,streetNumber:null,city:null,district:null,state:null,stateOrProvince:null},settings:b.settings,domContainer:a,geodecoder:new google.maps.Geocoder}}function c(a){return void 0!=d(a)}function d(b){return a(b).data("locationpicker")}function e(a,b){if(a){var c=i.locationFromLatLng(b.location);a.latitudeInput&&a.latitudeInput.val(c.latitude).change(),a.longitudeInput&&a.longitudeInput.val(c.longitude).change(),a.radiusInput&&a.radiusInput.val(b.radius).change(),a.locationNameInput&&a.locationNameInput.val(b.locationName).change()}}function f(b,c){if(b){if(b.radiusInput&&b.radiusInput.on("change",function(b){b.originalEvent&&(c.radius=a(this).val(),i.setPosition(c,c.location,function(a){a.settings.onchanged.apply(c.domContainer,[i.locationFromLatLng(a.location),a.radius,!1])}))}),b.locationNameInput&&c.settings.enableAutocomplete){var d=!1;c.autocomplete=new google.maps.places.Autocomplete(b.locationNameInput.get(0)),google.maps.event.addListener(c.autocomplete,"place_changed",function(){d=!1;var a=c.autocomplete.getPlace();return a.geometry?void i.setPosition(c,a.geometry.location,function(a){e(b,a),a.settings.onchanged.apply(c.domContainer,[i.locationFromLatLng(a.location),a.radius,!1])}):void c.settings.onlocationnotfound(a.name)}),c.settings.enableAutocompleteBlur&&(b.locationNameInput.on("change",function(a){a.originalEvent&&(d=!0)}),b.locationNameInput.on("blur",function(f){f.originalEvent&&setTimeout(function(){var f=a(b.locationNameInput).val();f.length>5&&d&&(d=!1,c.geodecoder.geocode({address:f},function(a,d){d==google.maps.GeocoderStatus.OK&&a&&a.length&&i.setPosition(c,a[0].geometry.location,function(a){e(b,a),a.settings.onchanged.apply(c.domContainer,[i.locationFromLatLng(a.location),a.radius,!1])})}))},1e3)}))}b.latitudeInput&&b.latitudeInput.on("change",function(b){b.originalEvent&&i.setPosition(c,new google.maps.LatLng(a(this).val(),c.location.lng()),function(a){a.settings.onchanged.apply(c.domContainer,[i.locationFromLatLng(a.location),a.radius,!1])})}),b.longitudeInput&&b.longitudeInput.on("change",function(b){b.originalEvent&&i.setPosition(c,new google.maps.LatLng(c.location.lat(),a(this).val()),function(a){a.settings.onchanged.apply(c.domContainer,[i.locationFromLatLng(a.location),a.radius,!1])})})}}function g(a){google.maps.event.trigger(a.map,"resize"),setTimeout(function(){a.map.setCenter(a.marker.position)},300)}function h(b,c,d){var e=a.extend({},a.fn.locationpicker.defaults,d),g=e.location.latitude,h=e.location.longitude,j=e.radius,k=b.settings.location.latitude,l=b.settings.location.longitude,m=b.settings.radius;(g!=k||h!=l||j!=m)&&(b.settings.location.latitude=g,b.settings.location.longitude=h,b.radius=j,i.setPosition(b,new google.maps.LatLng(b.settings.location.latitude,b.settings.location.longitude),function(a){f(b.settings.inputBinding,b),a.settings.oninitialized(c)}))}var i={drawCircle:function(b,c,d,e){return null!=b.circle&&b.circle.setMap(null),d>0?(d*=1,e=a.extend({strokeColor:"#0000FF",strokeOpacity:.35,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2},e),e.map=b.map,e.radius=d,e.center=c,b.circle=new google.maps.Circle(e),b.circle):null},setPosition:function(a,b,c){a.location=b,a.marker.setPosition(b),a.map.panTo(b),this.drawCircle(a,b,a.radius,{}),a.settings.enableReverseGeocode?a.geodecoder.geocode({latLng:a.location},function(b,d){d==google.maps.GeocoderStatus.OK&&b.length>0&&(a.locationName=b[0].formatted_address,a.addressComponents=i.address_component_from_google_geocode(b[0].address_components)),c&&c.call(this,a)}):c&&c.call(this,a)},locationFromLatLng:function(a){return{latitude:a.lat(),longitude:a.lng()}},address_component_from_google_geocode:function(a){for(var b={},c=a.length-1;c>=0;c--){var d=a[c];d.types.indexOf("postal_code")>=0?b.postalCode=d.short_name:d.types.indexOf("street_number")>=0?b.streetNumber=d.short_name:d.types.indexOf("route")>=0?b.streetName=d.short_name:d.types.indexOf("locality")>=0?b.city=d.short_name:d.types.indexOf("sublocality")>=0?b.district=d.short_name:d.types.indexOf("administrative_area_level_1")>=0?b.stateOrProvince=d.short_name:d.types.indexOf("country")>=0&&(b.country=d.short_name)}return b.addressLine1=[b.streetNumber,b.streetName].join(" ").trim(),b.addressLine2="",b}};a.fn.locationpicker=function(j,k){if("string"==typeof j){var l=this.get(0);if(!c(l))return;var m=d(l);switch(j){case"location":if(void 0==k){var n=i.locationFromLatLng(m.location);return n.radius=m.radius,n.name=m.locationName,n}k.radius&&(m.radius=k.radius),i.setPosition(m,new google.maps.LatLng(k.latitude,k.longitude),function(a){e(a.settings.inputBinding,a)});break;case"subscribe":if(void 0==k)return null;var o=k.event,p=k.callback;if(!o||!p)return console.error('LocationPicker: Invalid arguments for method "subscribe"'),null;google.maps.event.addListener(m.map,o,p);break;case"map":if(void 0==k){var q=i.locationFromLatLng(m.location);return q.formattedAddress=m.locationName,q.addressComponents=m.addressComponents,{map:m.map,marker:m.marker,location:q}}return null;case"autosize":return g(m),this}return null}return this.each(function(){var g=a(this);if(c(this))return void h(d(this),a(this),j);var k=a.extend({},a.fn.locationpicker.defaults,j),l=new b(this,{zoom:k.zoom,center:new google.maps.LatLng(k.location.latitude,k.location.longitude),mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1,disableDoubleClickZoom:!1,scrollwheel:k.scrollwheel,streetViewControl:!1,radius:k.radius,locationName:k.locationName,settings:k,draggable:k.draggable,markerIcon:k.markerIcon});g.data("locationpicker",l),google.maps.event.addListener(l.marker,"dragend",function(){i.setPosition(l,l.marker.position,function(a){var b=i.locationFromLatLng(l.location);a.settings.onchanged.apply(l.domContainer,[b,a.radius,!0]),e(l.settings.inputBinding,l)})}),i.setPosition(l,new google.maps.LatLng(k.location.latitude,k.location.longitude),function(a){e(k.inputBinding,l),f(k.inputBinding,l),a.settings.oninitialized(g)})})},a.fn.locationpicker.defaults={location:{latitude:40.7324319,longitude:-73.82480777777776},locationName:"",radius:500,zoom:15,scrollwheel:!0,inputBinding:{latitudeInput:null,longitudeInput:null,radiusInput:null,locationNameInput:null},enableAutocomplete:!1,enableAutocompleteBlur:!1,enableReverseGeocode:!0,draggable:!0,onchanged:function(){},onlocationnotfound:function(){},oninitialized:function(){},markerIcon:void 0}}(jQuery); +//# sourceMappingURL=locationpicker.jquery.min.js.map \ No newline at end of file diff --git a/dist/locationpicker.jquery.min.js.map b/dist/locationpicker.jquery.min.js.map new file mode 100644 index 0000000..d5843e1 --- /dev/null +++ b/dist/locationpicker.jquery.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"locationpicker.jquery.min.js","sources":["../src/locationpicker.jquery.js"],"names":["$","GMapContext","domElement","options","_map","google","maps","Map","_marker","Marker","position","LatLng","map","title","draggable","icon","undefined","markerIcon","marker","circle","location","radius","locationName","addressComponents","formatted_address","addressLine1","addressLine2","streetName","streetNumber","city","district","state","stateOrProvince","settings","domContainer","geodecoder","Geocoder","isPluginApplied","domObj","getContextForElement","data","updateInputValues","inputBinding","gmapContext","currentLocation","GmUtility","locationFromLatLng","latitudeInput","val","latitude","change","longitudeInput","longitude","radiusInput","locationNameInput","setupInputListenersInput","on","e","originalEvent","this","setPosition","context","onchanged","apply","enableAutocomplete","blur","autocomplete","places","Autocomplete","get","event","addListener","place","getPlace","geometry","onlocationnotfound","name","enableAutocompleteBlur","setTimeout","address","length","geocode","results","status","GeocoderStatus","OK","lng","lat","autosize","trigger","setCenter","updateMap","$target","extend","fn","locationpicker","defaults","latNew","lngNew","radiusNew","latOld","lngOld","radiusOld","oninitialized","drawCircle","center","setMap","strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity","Circle","gMapContext","callback","panTo","enableReverseGeocode","latLng","address_component_from_google_geocode","address_components","call","lnlg","result","i","component","types","indexOf","postalCode","short_name","country","join","trim","params","_targetDomElement","console","error","locationObj","formattedAddress","each","zoom","mapTypeId","MapTypeId","ROADMAP","mapTypeControl","disableDoubleClickZoom","scrollwheel","streetViewControl","jQuery"],"mappings":";;CAAC,SAAWA,GAMR,QAASC,GAAYC,EAAYC,GAC7B,GAAIC,GAAO,GAAIC,QAAOC,KAAKC,IAAIL,EAAYC,GACvCK,EAAU,GAAIH,QAAOC,KAAKG,QAC1BC,SAAU,GAAIL,QAAOC,KAAKK,OAAO,SAAU,UAC3CC,IAAKR,EACLS,MAAO,UACPC,UAAWX,EAAQW,UACnBC,KAA8BC,SAAvBb,EAAQc,WAA4Bd,EAAQc,WAAaD,QAEpE,QACIJ,IAAKR,EACLc,OAAQV,EACRW,OAAQ,KACRC,SAAUZ,EAAQE,SAClBW,OAAQlB,EAAQkB,OAChBC,aAAcnB,EAAQmB,aACtBC,mBACIC,kBAAmB,KACnBC,aAAc,KACdC,aAAc,KACdC,WAAY,KACZC,aAAc,KACdC,KAAM,KACNC,SAAU,KACVC,MAAO,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ACbC,kBAAmB,MAEvBU,oBAAoB,EACpBa,wBAAwB,EACxBuC,sBAAsB,EACtBtG,WAAW,EACXgD,UAAW,aACXa,mBAAoB,aACpB4B,cAAe,aAEftF,WAAYD,SAEjBmI"} \ No newline at end of file diff --git a/dist/locationpicker.jquery.min.map b/dist/locationpicker.jquery.min.map deleted file mode 100644 index 9472887..0000000 --- a/dist/locationpicker.jquery.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locationpicker.jquery.min.js","sources":["../src/locationpicker.jquery.js"],"names":["$","GMapContext","domElement","options","_map","google","maps","Map","_marker","Marker","position","LatLng","map","title","draggable","marker","circle","location","radius","locationName","addressComponents","formatted_address","addressLine1","addressLine2","streetName","streetNumber","city","district","state","stateOrProvince","settings","domContainer","geodecoder","Geocoder","isPluginApplied","domObj","undefined","getContextForElement","data","updateInputValues","inputBinding","gmapContext","currentLocation","GmUtility","locationFromLatLng","latitudeInput","val","latitude","change","longitudeInput","longitude","radiusInput","locationNameInput","setupInputListenersInput","on","e","originalEvent","this","setPosition","context","onchanged","apply","enableAutocomplete","autocomplete","places","Autocomplete","get","event","addListener","place","getPlace","geometry","onlocationnotfound","name","lng","lat","autosize","trigger","setTimeout","setCenter","drawCircle","center","setMap","extend","strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity","Circle","gMapContext","callback","panTo","enableReverseGeocode","geocode","latLng","results","status","GeocoderStatus","OK","length","address_component_from_google_geocode","address_components","call","lnlg","result","i","component","types","indexOf","postalCode","short_name","country","join","trim","fn","locationpicker","params","_targetDomElement","console","error","locationObj","formattedAddress","each","$target","defaults","zoom","mapTypeId","MapTypeId","ROADMAP","mapTypeControl","disableDoubleClickZoom","scrollwheel","streetViewControl","oninitialized","jQuery"],"mappings":";;CAAC,SAAWA,GAMR,QAASC,GAAYC,EAAYC,GAC7B,GAAIC,GAAO,GAAIC,QAAOC,KAAKC,IAAIL,EAAYC,GACvCK,EAAU,GAAIH,QAAOC,KAAKG,QAC1BC,SA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V,SAI3C5H,EAAEmH,GAAGC,eAAeS,UAChB5G,UAAW8B,SAAU,WAAYG,UAAW,oBAC5C/B,aAAc,GACdD,OAAQ,IACR4G,KAAM,GACNM,aAAa,EACb5F,cACIK,cAAe,KACfI,eAAgB,KAChBE,YAAa,KACbC,kBAAmB,MAEvBU,oBAAoB,EACpB+B,sBAAsB,EACtB/E,WAAW,EACX8C,UAAW,aACXY,mBAAoB,aACpB8D,cAAe,eAIpBC"} \ No newline at end of file diff --git a/examples/examples.html b/examples/examples.html index 713da3e..5ace968 100644 --- a/examples/examples.html +++ b/examples/examples.html @@ -1,6 +1,6 @@ - + @@ -10,45 +10,54 @@ - + - + jquery-location-picker demo + -
-
-

+

+
+

-

Providing options

-
+                

Providing options

+
 <div id="somecomponent" style="width: 500px; height: 400px;"></div>
 <script>
 $('#somecomponent').locationpicker({
 	location: {latitude: 46.15242437752303, longitude: 2.7470703125},
-	radius: 300
-	});
-</script>				
+	radius: 300,
+        markerIcon: 'http://www.iconsdb.com/icons/preview/tropical-blue/map-marker-2-xl.png'
+});
+</script>
 				
-

Result

+

Result

+ +
+ + }); + -

Binding UI with the widget

-
+                

Binding UI with the widget

+
 Location: <input type="text" id="us2-address" style="width: 200px"/>
 Radius: <input type="text" id="us2-radius"/>
-<div id="us2" style="width: 500px; height: 400px;"></div>				
+<div id="us2" style="width: 500px; height: 400px;"></div>
 Lat.: <input type="text" id="us2-lat"/>
 Long.: <input type="text" id="us2-lon"/>
 <script>$('#us2').locationpicker({
-	location: {latitude: 46.15242437752303, longitude: 2.7470703125},	
+	location: {latitude: 46.15242437752303, longitude: 2.7470703125},
 	radius: 300,
 	inputBinding: {
         latitudeInput: $('#us2-lat'),
@@ -57,106 +66,130 @@ 

Binding UI with the widget

locationNameInput: $('#us2-address') } }); -</script> +</script>
-

Result:

+

Result:

-
-
- +
+
+ -
-
-
- +
+ +
+
+
+ -
-
-
-
 
-
- +
+ +
+
+
+
 
+
+ -
- +
+ +
+ -
-
-
-
- +
+ +
+
+
+
+ -

Subscribing for events

+

Subscribing for events

-

The following example illustrates how to subscribe "Change" event. See the list of the available events along - with functions signature above.

-
+                

The following example illustrates how to subscribe "Change" event. See the list of the available events along with functions signature above.

+
 $('#us3').locationpicker({
-location: {latitude: 46.15242437752303, longitude: 2.7470703125},	
+location: {latitude: 46.15242437752303, longitude: 2.7470703125},
 radius: 300,
 inputBinding: {
 	latitudeInput: $('#us3-lat'),
 	longitudeInput: $('#us3-lon'),
 	radiusInput: $('#us3-radius'),
-	locationNameInput: $('#us3-address')        
+	locationNameInput: $('#us3-address')
 },
 enableAutocomplete: true,
 onchanged: function(currentLocation, radius, isMarkerDropped) {
 	alert("Location changed. New location (" + currentLocation.latitude + ", " + currentLocation.longitude + ")");
-}				
+}
 				
-
-
- +
+
+ -
-
-
- +
+ +
+
+
+ -
-
-
-
 
-
- +
+ +
+
+
+
 
+
+ -
- +
+ +
+ -
-
-
- -
-

Manipulating map widget from callback

+
+ +
+
+
+ +
+

Manipulating map widget from callback

-

If you need direct access to the actual Google Maps widget you can use map method as follows. - This example illustrates how to set zoom pragmatically each time when location has been changed.

-
+                

If you need direct access to the actual Google Maps widget you can use map method as follows. This example illustrates how to set zoom pragmatically each time when location has been changed.

+
 $('#us4').locationpicker({
 location: {latitude: 46.15242437752303, longitude: 2.7470703125},
 radius: 300,
@@ -165,26 +198,29 @@ 

Manipulating map widget from callback

mapContext.map.setZoom(20); }
-
-
- -
+
+
+ +
-

Advanced usage of geo decoder features

+

Advanced usage of geo decoder features

-

- Along with decoded readable location name plugin returns address split on components - (state, postal code, etc.) which in some cases can be pretty useful. -

-
+                

+ Along with decoded readable location name plugin returns address split on components (state, postal code, etc.) which in some cases can be pretty useful. +

+
 function updateControls(addressComponents) {
     $('#us5-street1').val(addressComponents.addressLine1);
     $('#us5-city').val(addressComponents.city);
@@ -205,87 +241,90 @@ 

Advanced usage of geo decoder features

} });
-
-
-
-
-

-
-
-
-
- - -
- -
+
+
+
+
+

-
- +
+
+
+ -
- -
-
-
- +
+ +
+
+
+ -
- -
-
-
- +
+ +
+
+
+ -
- -
-
-
- +
+ +
+
+
+ + +
+ +
+
+
+ -
- +
+ +
+
+
+ +
+ +
+ Dmitry Berezovsky, Logicify (http://logicify.com/)
-
-
- -
-
- - Dmitry Berezovsky, Logicify (http://logicify.com/)
+
- -
+ diff --git a/examples/mapInModalDialog.html b/examples/mapInModalDialog.html index a03aa6c..7502303 100644 --- a/examples/mapInModalDialog.html +++ b/examples/mapInModalDialog.html @@ -1,5 +1,6 @@ + @@ -12,68 +13,84 @@ Simple example + - -