PHP Classes

File: public/public/modules/theme-business/js/vendor/jquery.gmap.min.js

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   LaraCMS   public/public/modules/theme-business/js/vendor/jquery.gmap.min.js   Download  
File: public/public/modules/theme-business/js/vendor/jquery.gmap.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: LaraCMS
Content management system based on Laravel
Author: By
Last change:
Date: 1 year ago
Size: 3,563 bytes
 

Contents

Class file image Download
!function(i){i.fn.gMap=function(e,o){switch(e){case"addMarker":return i(this).trigger("gMap.addMarker",[o.latitude,o.longitude,o.content,o.icon,o.popup]);case"centerAt":return i(this).trigger("gMap.centerAt",[o.latitude,o.longitude,o.zoom]);case"clearMarkers":return i(this).trigger("gMap.clearMarkers")}var w=i.extend({},i.fn.gMap.defaults,e);return this.each(function(){var c=new google.maps.Map(this);i(this).data("gMap.reference",c);var e=new google.maps.Geocoder;w.address?e.geocode({address:w.address},function(e,o){e&&e.length&&c.setCenter(e[0].geometry.location)}):w.latitude&&w.longitude?c.setCenter(new google.maps.LatLng(w.latitude,w.longitude)):i.isArray(w.markers)&&0<w.markers.length?w.markers[0].address?e.geocode({address:w.markers[0].address},function(e,o){e&&0<e.length&&c.setCenter(e[0].geometry.location)}):c.setCenter(new google.maps.LatLng(w.markers[0].latitude,w.markers[0].longitude)):c.setCenter(new google.maps.LatLng(34.885931,9.84375)),c.setZoom(w.zoom),c.setMapTypeId(google.maps.MapTypeId[w.maptype]);var o={scrollwheel:w.scrollwheel,disableDoubleClickZoom:!w.doubleclickzoom};!1===w.controls?i.extend(o,{disableDefaultUI:!0}):0!==w.controls.length&&i.extend(o,w.controls,{disableDefaultUI:!0}),c.setOptions(o);var a,p=new google.maps.Marker,n=new google.maps.MarkerImage(w.icon.image);n.size=new google.maps.Size(w.icon.iconsize[0],w.icon.iconsize[1]),n.anchor=new google.maps.Point(w.icon.iconanchor[0],w.icon.iconanchor[1]),p.setIcon(n),w.icon.shadow&&((a=new google.maps.MarkerImage(w.icon.shadow)).size=new google.maps.Size(w.icon.shadowsize[0],w.icon.shadowsize[1]),a.anchor=new google.maps.Point(w.icon.shadowanchor[0],w.icon.shadowanchor[1]),p.setShadow(a)),i(this).bind("gMap.centerAt",function(e,o,a,n){n&&c.setZoom(n),c.panTo(new google.maps.LatLng(parseFloat(o),parseFloat(a)))});var m,s,h=[];i(this).bind("gMap.clearMarkers",function(){for(;h[0];)h.pop().setMap(null)}),i(this).bind("gMap.addMarker",function(e,o,a,n,s,t){var r,i,g,l=new google.maps.LatLng(parseFloat(o),parseFloat(a)),d=new google.maps.Marker({position:l});s?((r=new google.maps.MarkerImage(s.image)).size=new google.maps.Size(s.iconsize[0],s.iconsize[1]),r.anchor=new google.maps.Point(s.iconanchor[0],s.iconanchor[1]),d.setIcon(r),s.shadow&&((i=new google.maps.MarkerImage(s.shadow)).size=new google.maps.Size(s.shadowsize[0],s.shadowsize[1]),i.anchor=new google.maps.Point(s.shadowanchor[0],s.shadowanchor[1]),p.setShadow(i))):(d.setIcon(p.getIcon()),d.setShadow(p.getShadow())),n&&("_latlng"===n&&(n=o+", "+a),g=new google.maps.InfoWindow({content:w.html_prepend+n+w.html_append}),google.maps.event.addListener(d,"click",function(){m&&m.close(),g.open(c,d),m=g}),t&&google.maps.event.addListenerOnce(c,"tilesloaded",function(){g.open(c,d)})),d.setMap(c),h.push(d)});for(var t=this,r=0;r<w.markers.length;r++)(s=w.markers[r]).address?("_address"===s.html&&(s.html=s.address),e.geocode({address:s.address},function(a){return function(e,o){e&&0<e.length&&i(t).trigger("gMap.addMarker",[e[0].geometry.location.lat(),e[0].geometry.location.lng(),a.html,a.icon,a.popup])}}(s))):i(this).trigger("gMap.addMarker",[s.latitude,s.longitude,s.html,s.icon,s.popup])})},i.fn.gMap.defaults={address:"",latitude:0,longitude:0,zoom:1,markers:[],controls:[],scrollwheel:!1,doubleclickzoom:!0,maptype:"ROADMAP",html_prepend:'<div class="gmap_marker">',html_append:"</div>",icon:{image:"http://www.google.com/mapfiles/marker.png",shadow:"http://www.google.com/mapfiles/shadow50.png",iconsize:[20,34],shadowsize:[37,34],iconanchor:[9,34],shadowanchor:[6,34]}}}(jQuery);