File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/vedaaweddingpartys.com/js/jquery.googlemap.js
Back
$(function(){$.fn.googleMap=function(e){switch((e=$.extend({zoom:10,coords:[48.895651,2.290569],type:"ROADMAP",debug:!1,langage:"english",overviewMapControl:!1,streetViewControl:!1,scrollwheel:!1,mapTypeControl:!1},e)).type){case"ROADMAP":case"SATELLITE":case"HYBRID":case"TERRAIN":e.type=google.maps.MapTypeId[e.type];break;default:e.type=google.maps.MapTypeId.ROADMAP}return this.each(function(){var o=new google.maps.Map(this,{zoom:e.zoom,center:new google.maps.LatLng(e.coords[0],e.coords[1]),mapTypeId:e.type,scrollwheel:e.scrollwheel,streetViewControl:e.streetViewControl,overviewMapControl:e.overviewMapControl,mapTypeControl:e.mapTypeControl});$(this).data("googleMap",o),$(this).data("googleLang",e.langage),$(this).data("googleDebug",e.debug),$(this).data("googleMarker",new Array),$(this).data("googleBound",new google.maps.LatLngBounds)}),this},$.fn.addMarker=function(e){return e=$.extend({coords:!1,address:!1,url:!1,id:!1,icon:!1,draggable:!1,title:"",text:"",success:function(){}},e),this.each(function(){if($this=$(this),!$this.data("googleMap"))return $this.data("googleDebug")&&console.error("jQuery googleMap : Unable to add a marker where there is no map !"),!1;if(!e.coords&&!e.address)return $this.data("googleDebug")&&console.error("jQuery googleMap : Unable to add a marker if you don't tell us where !"),!1;if(e.address&&"string"==typeof e.address)g=$this,(new google.maps.Geocoder).geocode({address:e.address,bounds:g.data("googleBound"),language:g.data("googleLang")},function(o,a){if(a==google.maps.GeocoderStatus.OK){if(g.data("googleBound").extend(o[0].geometry.location),e.icon)var t=new google.maps.Marker({map:$this.data("googleMap"),position:o[0].geometry.location,title:e.title,icon:e.icon,draggable:e.draggable});else t=new google.maps.Marker({map:g.data("googleMap"),position:o[0].geometry.location,title:e.title,draggable:e.draggable});if(e.draggable&&google.maps.event.addListener(t,"dragend",function(){var o=t.getPosition(),a={};a.lat=o.lat(),a.lon=o.lng(),e.success(a,$this)}),""==e.title||""==e.text||e.url)e.url&&google.maps.event.addListener(t,"click",function(){document.location=e.url});else{var n=new google.maps.InfoWindow({content:"<h1>"+e.title+"</h1>"+e.text}),r=g.data("googleMap");google.maps.event.addListener(t,"click",function(){n.open(r,t)})}e.id?g.data("googleMarker")[e.id]=t:g.data("googleMarker").push(t),1==g.data("googleMarker").length?(g.data("googleMap").setCenter(o[0].geometry.location),g.data("googleMap").setZoom(g.data("googleMap").getZoom())):g.data("googleMap").fitBounds(g.data("googleBound"));var s={};s.lat=o[0].geometry.location.lat(),s.lon=o[0].geometry.location.lng(),e.success(s,$this)}else $this.data("googleDebug")&&console.error("jQuery googleMap : Unable to find the place asked for the marker ("+a+")")});else{if($this.data("googleBound").extend(new google.maps.LatLng(e.coords[0],e.coords[1])),e.icon)var o=new google.maps.Marker({map:$this.data("googleMap"),position:new google.maps.LatLng(e.coords[0],e.coords[1]),title:e.title,icon:e.icon,draggable:e.draggable});else o=new google.maps.Marker({map:$this.data("googleMap"),position:new google.maps.LatLng(e.coords[0],e.coords[1]),title:e.title,draggable:e.draggable});if(""==e.title||""==e.text||e.url)e.url&&google.maps.event.addListener(o,"click",function(){document.location=e.url});else{var a=new google.maps.InfoWindow({content:"<h1>"+e.title+"</h1>"+e.text}),t=$this.data("googleMap");google.maps.event.addListener(o,"click",function(){a.open(t,o)})}e.draggable&&google.maps.event.addListener(o,"dragend",function(){var a=o.getPosition(),t={};t.lat=a.lat(),t.lon=a.lng(),e.success(t,$this)}),e.id?$this.data("googleMarker")[e.id]=o:$this.data("googleMarker").push(o),1==$this.data("googleMarker").length?($this.data("googleMap").setCenter(new google.maps.LatLng(e.coords[0],e.coords[1])),$this.data("googleMap").setZoom($this.data("googleMap").getZoom())):$this.data("googleMap").fitBounds($this.data("googleBound")),e.success({lat:e.coords[0],lon:e.coords[1]},$this)}var g}),this},$.fn.removeMarker=function(e){this.each(function(){var o=$(this);if(!o.data("googleMap"))return o.data("googleDebug")&&console.log("jQuery googleMap : Unable to delete a marker where there is no map !"),!1;var a=o.data("googleMarker");return void 0!==a[e]?(a[e].setMap(null),o.data("googleDebug")&&console.log("jQuery googleMap : marker deleted"),!0):(o.data("googleDebug")&&console.error("jQuery googleMap : Unable to delete a marker if it not exists !"),!1)})},$.fn.addWay=function(e){e=$.extend({start:!1,end:!1,step:[],route:!1,langage:"english"},e);var o=new google.maps.DirectionsService({region:"fr"}),a=new google.maps.DirectionsRenderer({draggable:!0,map:$(this).data("googleMap"),panel:document.getElementById(e.route),provideTripAlternatives:!0});document.getElementById.innerHTML="";var t,g=[];for(var n in e.step){var r;r="object"==typeof e.step[n]?new google.maps.LatLng(e.step[n][0],e.step[n][1]):e.step[n],g.push({location:r,stopover:!0})}if("object"!=typeof e.end)t=$(this),(new google.maps.Geocoder).geocode({address:e.end,bounds:t.data("googleBound"),language:e.langage},function(n,r){if(r==google.maps.GeocoderStatus.OK){var s={origin:e.start,destination:n[0].geometry.location,travelMode:google.maps.DirectionsTravelMode.DRIVING,region:"fr",waypoints:g};o.route(s,function(e,o){o==google.maps.DirectionsStatus.OK?a.setDirections(e):t.data("googleDebug")&&console.error("jQuery googleMap : Unable to find the place asked for the route ("+e+")")})}else t.data("googleDebug")&&console.error("jQuery googleMap : Address not found")});else{var s={origin:e.start,destination:new google.maps.LatLng(e.end[0],e.end[1]),travelMode:google.maps.DirectionsTravelMode.DRIVING,region:"fr",waypoints:g};o.route(s,function(e,o){o==google.maps.DirectionsStatus.OK?a.setDirections(e):$(this).data("googleDebug")&&console.error("jQuery googleMap : Address not found")})}return this}}),$(window).load(function(){$("#map-canvas").googleMap({zoom:5,coords:[48.870356,2.322645],type:"ROADMAP",address:"Canal Saint-Martin, Paris, France",infoWindow:{content:'<p style="text-align:center;"><strong>Canal Saint-Martin,</strong><br> Paris, France</p>'}}),$("#map-canvas").addMarker({coords:[48.870356,2.322645]}),$("#map-canvas").addMarker({coords:[48.865358,2.348607]})});
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings