You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gmap3.min.js 25KB

1
  1. /*! SmartAdmin - v1.5 - 2014-09-22 */!function(a,b){function c(a){return"object"==typeof a}function d(a){return"string"==typeof a}function e(a){return"number"==typeof a}function f(a){return a===b}function g(){M=google.maps,L||(L={"verbose":!1,"queryLimit":{"attempt":5,"delay":250,"random":250},"classes":function(){var b={};return a.each("Map Marker InfoWindow Circle Rectangle OverlayView StreetViewPanorama KmlLayer TrafficLayer BicyclingLayer GroundOverlay StyledMapType ImageMapType".split(" "),function(a,c){b[c]=M[c]}),b}(),"map":{"mapTypeId":M.MapTypeId.ROADMAP,"center":[46.578498,2.457275],"zoom":2},"overlay":{"pane":"floatPane","content":"","offset":{"x":0,"y":0}},"geoloc":{"getCurrentPosition":{"maximumAge":6e4,"timeout":5e3}}})}function h(a,b){return f(a)?"gmap3_"+(b?N+1:++N):a}function i(a){var b,c=M.version.split(".");for(a=a.split("."),b=0;b<c.length;b++)c[b]=parseInt(c[b],10);for(b=0;b<a.length;b++){if(a[b]=parseInt(a[b],10),!c.hasOwnProperty(b))return!1;if(c[b]<a[b])return!1}return!0}function j(b,c,d,e,f){function g(c,e){c&&a.each(c,function(a,c){var g=b,h=c;P(c)&&(g=c[0],h=c[1]),e(d,a,function(a){h.apply(g,[f||d,a,i])})})}var h=c.td||{},i={"id":e,"data":h.data,"tag":h.tag};g(h.events,M.event.addListener),g(h.onces,M.event.addListenerOnce)}function k(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push(b);return c}function l(a,b){var c,d=arguments;for(c=2;c<d.length;c++)if(b in d[c]&&d[c].hasOwnProperty(b))return void(a[b]=d[c][b])}function m(b,c){var d,e,f=["data","tag","id","events","onces"],g={};if(b.td)for(d in b.td)b.td.hasOwnProperty(d)&&"options"!==d&&"values"!==d&&(g[d]=b.td[d]);for(e=0;e<f.length;e++)l(g,f[e],c,b.td);return g.options=a.extend({},b.opts||{},c.options||{}),g}function n(){if(L.verbose){var a,b=[];if(window.console&&O(console.error)){for(a=0;a<arguments.length;a++)b.push(arguments[a]);console.error.apply(console,b)}else{for(b="",a=0;a<arguments.length;a++)b+=arguments[a].toString()+" ";alert(b)}}}function o(a){return(e(a)||d(a))&&""!==a&&!isNaN(a)}function p(a){var b,d=[];if(!f(a))if(c(a))if(e(a.length))d=a;else for(b in a)d.push(a[b]);else d.push(a);return d}function q(b){return b?O(b)?b:(b=p(b),function(d){var e;if(f(d))return!1;if(c(d)){for(e=0;e<d.length;e++)if(a.inArray(d[e],b)>=0)return!0;return!1}return a.inArray(d,b)>=0}):void 0}function r(a,b,c){var e=b?a:null;return!a||d(a)?e:a.latLng?r(a.latLng):a instanceof M.LatLng?a:o(a.lat)?new M.LatLng(a.lat,a.lng):!c&&P(a)&&o(a[0])&&o(a[1])?new M.LatLng(a[0],a[1]):e}function s(a){var b,c;return!a||a instanceof M.LatLngBounds?a||null:(P(a)?2===a.length?(b=r(a[0]),c=r(a[1])):4===a.length&&(b=r([a[0],a[1]]),c=r([a[2],a[3]])):"ne"in a&&"sw"in a?(b=r(a.ne),c=r(a.sw)):"n"in a&&"e"in a&&"s"in a&&"w"in a&&(b=r([a.n,a.e]),c=r([a.s,a.w])),b&&c?new M.LatLngBounds(c,b):null)}function t(a,b,c,e,f){var g=c?r(e.td,!1,!0):!1,h=g?{"latLng":g}:e.td.address?d(e.td.address)?{"address":e.td.address}:e.td.address:!1,i=h?R.get(h):!1,j=this;h?(f=f||0,i?(e.latLng=i.results[0].geometry.location,e.results=i.results,e.status=i.status,b.apply(a,[e])):(h.location&&(h.location=r(h.location)),h.bounds&&(h.bounds=s(h.bounds)),x().geocode(h,function(d,g){g===M.GeocoderStatus.OK?(R.store(h,{"results":d,"status":g}),e.latLng=d[0].geometry.location,e.results=d,e.status=g,b.apply(a,[e])):g===M.GeocoderStatus.OVER_QUERY_LIMIT&&f<L.queryLimit.attempt?setTimeout(function(){t.apply(j,[a,b,c,e,f+1])},L.queryLimit.delay+Math.floor(Math.random()*L.queryLimit.random)):(n("geocode failed",g,h),e.latLng=e.results=!1,e.status=g,b.apply(a,[e]))}))):(e.latLng=r(e.td,!1,!0),b.apply(a,[e]))}function u(b,c,d,e){function f(){do h++;while(h<b.length&&!("address"in b[h]));return h>=b.length?void d.apply(c,[e]):void t(g,function(c){delete c.td,a.extend(b[h],c),f.apply(g,[])},!0,{"td":b[h]})}var g=this,h=-1;f()}function v(a,b,c){var d=!1;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){d||(d=!0,c.latLng=new M.LatLng(e.coords.latitude,e.coords.longitude),b.apply(a,[c]))},function(){d||(d=!0,c.latLng=!1,b.apply(a,[c]))},c.opts.getCurrentPosition):(c.latLng=!1,b.apply(a,[c]))}function w(a){var b,d=!1;if(c(a)&&a.hasOwnProperty("get")){for(b in a)if("get"!==b)return!1;d=!a.get.hasOwnProperty("callback")}return d}function x(){return Q.geocoder||(Q.geocoder=new M.Geocoder),Q.geocoder}function y(){var a=[];this.get=function(b){if(a.length){var d,e,f,g,h,i=k(b);for(d=0;d<a.length;d++){for(g=a[d],h=i.length===g.keys.length,e=0;e<i.length&&h;e++)f=i[e],h=f in g.request,h&&(h=c(b[f])&&"equals"in b[f]&&O(b[f])?b[f].equals(g.request[f]):b[f]===g.request[f]);if(h)return g.results}}},this.store=function(b,c){a.push({"request":b,"keys":k(b),"results":c})}}function z(){var a=[],b=this;b.empty=function(){return!a.length},b.add=function(b){a.push(b)},b.get=function(){return a.length?a[0]:!1},b.ack=function(){a.shift()}}function A(){function b(a){return{"id":a.id,"name":a.name,"object":a.obj,"tag":a.tag,"data":a.data}}function c(a){O(a.setMap)&&a.setMap(null),O(a.remove)&&a.remove(),O(a.free)&&a.free(),a=null}var d={},e={},g=this;g.add=function(a,b,c,f){var i=a.td||{},j=h(i.id);return d[b]||(d[b]=[]),j in e&&g.clearById(j),e[j]={"obj":c,"sub":f,"name":b,"id":j,"tag":i.tag,"data":i.data},d[b].push(j),j},g.getById=function(a,c,d){var f=!1;return a in e&&(f=c?e[a].sub:d?b(e[a]):e[a].obj),f},g.get=function(a,c,f,g){var h,i,j=q(f);if(!d[a]||!d[a].length)return null;for(h=d[a].length;h;)if(h--,i=d[a][c?h:d[a].length-h-1],i&&e[i]){if(j&&!j(e[i].tag))continue;return g?b(e[i]):e[i].obj}return null},g.all=function(a,c,g){var h=[],i=q(c),j=function(a){var c,f;for(c=0;c<d[a].length;c++)if(f=d[a][c],f&&e[f]){if(i&&!i(e[f].tag))continue;h.push(g?b(e[f]):e[f].obj)}};if(a in d)j(a);else if(f(a))for(a in d)j(a);return h},g.rm=function(a,b,c){var f,h;if(!d[a])return!1;if(b)if(c)for(f=d[a].length-1;f>=0&&(h=d[a][f],!b(e[h].tag));f--);else for(f=0;f<d[a].length&&(h=d[a][f],!b(e[h].tag));f++);else f=c?d[a].length-1:0;return f in d[a]?g.clearById(d[a][f],f):!1},g.clearById=function(a,b){if(a in e){var g,h=e[a].name;for(g=0;f(b)&&g<d[h].length;g++)a===d[h][g]&&(b=g);return c(e[a].obj),e[a].sub&&c(e[a].sub),delete e[a],d[h].splice(b,1),!0}return!1},g.objGetById=function(a){var b,c;if(d.clusterer)for(c in d.clusterer)if((b=e[d.clusterer[c]].obj.getById(a))!==!1)return b;return!1},g.objClearById=function(a){var b;if(d.clusterer)for(b in d.clusterer)if(e[d.clusterer[b]].obj.clearById(a))return!0;return null},g.clear=function(a,b,c,e){var f,h,i,j=q(e);if(a&&a.length)a=p(a);else{a=[];for(f in d)a.push(f)}for(h=0;h<a.length;h++)if(i=a[h],b)g.rm(i,j,!0);else if(c)g.rm(i,j,!1);else for(;g.rm(i,j,!1););},g.objClear=function(b,c,f,g){var h;if(d.clusterer&&(a.inArray("marker",b)>=0||!b.length))for(h in d.clusterer)e[d.clusterer[h]].obj.clear(c,f,g)}}function B(b,c,e){function f(a){var b={};return b[a]={},b}function g(){var a;for(a in e)if(e.hasOwnProperty(a)&&!i.hasOwnProperty(a))return a}var h,i={},j=this,k={"latLng":{"map":!1,"marker":!1,"infowindow":!1,"circle":!1,"overlay":!1,"getlatlng":!1,"getmaxzoom":!1,"getelevation":!1,"streetviewpanorama":!1,"getaddress":!0},"geoloc":{"getgeoloc":!0}};d(e)&&(e=f(e)),j.run=function(){for(var d,f;d=g();){if(O(b[d]))return h=d,f=a.extend(!0,{},L[d]||{},e[d].options||{}),void(d in k.latLng?e[d].values?u(e[d].values,b,b[d],{"td":e[d],"opts":f,"session":i}):t(b,b[d],k.latLng[d],{"td":e[d],"opts":f,"session":i}):d in k.geoloc?v(b,b[d],{"td":e[d],"opts":f,"session":i}):b[d].apply(b,[{"td":e[d],"opts":f,"session":i}]));i[d]=null}c.apply(b,[e,i])},j.ack=function(a){i[h]=a,j.run.apply(j,[])}}function C(){return Q.ds||(Q.ds=new M.DirectionsService),Q.ds}function D(){return Q.dms||(Q.dms=new M.DistanceMatrixService),Q.dms}function E(){return Q.mzs||(Q.mzs=new M.MaxZoomService),Q.mzs}function F(){return Q.es||(Q.es=new M.ElevationService),Q.es}function G(a){function b(){var a=this;return a.onAdd=function(){},a.onRemove=function(){},a.draw=function(){},L.classes.OverlayView.apply(a,[])}b.prototype=L.classes.OverlayView.prototype;var c=new b;return c.setMap(a),c}function H(b,d,e){function f(a){H[a]||(delete I[a].options.map,H[a]=new L.classes.Marker(I[a].options),j(b,{"td":I[a]},H[a],I[a].id))}function g(){return(s=K.getProjection())?(z=!0,C.push(M.event.addListener(d,"zoom_changed",n)),C.push(M.event.addListener(d,"bounds_changed",n)),void p()):void setTimeout(function(){g.apply(B,[])},25)}function i(a){c(D[a])?(O(D[a].obj.setMap)&&D[a].obj.setMap(null),O(D[a].obj.remove)&&D[a].obj.remove(),O(D[a].shadow.remove)&&D[a].obj.remove(),O(D[a].shadow.setMap)&&D[a].shadow.setMap(null),delete D[a].obj,delete D[a].shadow):H[a]&&H[a].setMap(null),delete D[a]}function k(){var a,b,c,d,e,f,g,h,i=Math.cos,j=Math.sin,k=arguments;return k[0]instanceof M.LatLng?(a=k[0].lat(),c=k[0].lng(),k[1]instanceof M.LatLng?(b=k[1].lat(),d=k[1].lng()):(b=k[1],d=k[2])):(a=k[0],c=k[1],k[2]instanceof M.LatLng?(b=k[2].lat(),d=k[2].lng()):(b=k[2],d=k[3])),e=Math.PI*a/180,f=Math.PI*c/180,g=Math.PI*b/180,h=Math.PI*d/180,6371e3*Math.acos(Math.min(i(e)*i(g)*i(f)*i(h)+i(e)*j(f)*i(g)*j(h)+j(e)*j(g),1))}function l(){var a=k(d.getCenter(),d.getBounds().getNorthEast()),b=new M.Circle({"center":d.getCenter(),"radius":1.25*a});return b.getBounds()}function m(){var a,b={};for(a in D)b[a]=!0;return b}function n(){clearTimeout(r),r=setTimeout(p,25)}function o(a){var b=s.fromLatLngToDivPixel(a),c=s.fromDivPixelToLatLng(new M.Point(b.x+e.radius,b.y-e.radius)),d=s.fromDivPixelToLatLng(new M.Point(b.x-e.radius,b.y+e.radius));return new M.LatLngBounds(d,c)}function p(){if(!w&&!y&&z){var b,c,f,g,h,j,k,n,p,q,r,s=!1,v=[],B={},C=d.getZoom(),E="maxZoom"in e&&C>e.maxZoom,F=m();for(x=!1,C>3&&(h=l(),s=h.getSouthWest().lng()<h.getNorthEast().lng()),b=0;b<I.length;b++)!I[b]||s&&!h.contains(I[b].options.position)||t&&!t(J[b])||v.push(b);for(;;){for(b=0;B[b]&&b<v.length;)b++;if(b===v.length)break;if(g=[],A&&!E){r=10;do for(n=g,g=[],r--,k=n.length?h.getCenter():I[v[b]].options.position,h=o(k),c=b;c<v.length;c++)B[c]||h.contains(I[v[c]].options.position)&&g.push(c);while(n.length<g.length&&g.length>1&&r)}else for(c=b;c<v.length;c++)if(!B[c]){g.push(c);break}for(j={"indexes":[],"ref":[]},p=q=0,f=0;f<g.length;f++)B[g[f]]=!0,j.indexes.push(v[g[f]]),j.ref.push(v[g[f]]),p+=I[v[g[f]]].options.position.lat(),q+=I[v[g[f]]].options.position.lng();p/=g.length,q/=g.length,j.latLng=new M.LatLng(p,q),j.ref=j.ref.join("-"),j.ref in F?delete F[j.ref]:(1===g.length&&(D[j.ref]=!0),u(j))}a.each(F,function(a){i(a)}),y=!1}}var r,s,t,u,v,w=!1,x=!1,y=!1,z=!1,A=!0,B=this,C=[],D={},E={},F={},H=[],I=[],J=[],K=G(d,e.radius);g(),B.getById=function(a){return a in E?(f(E[a]),H[E[a]]):!1},B.rm=function(a){var b=E[a];H[b]&&H[b].setMap(null),delete H[b],H[b]=!1,delete I[b],I[b]=!1,delete J[b],J[b]=!1,delete E[a],delete F[b],x=!0},B.clearById=function(a){return a in E?(B.rm(a),!0):void 0},B.clear=function(a,b,c){var d,e,f,g,h,i=[],j=q(c);for(a?(d=I.length-1,e=-1,f=-1):(d=0,e=I.length,f=1),g=d;g!==e&&(!I[g]||j&&!j(I[g].tag)||(i.push(F[g]),!b&&!a));g+=f);for(h=0;h<i.length;h++)B.rm(i[h])},B.add=function(a,b){a.id=h(a.id),B.clearById(a.id),E[a.id]=H.length,F[H.length]=a.id,H.push(null),I.push(a),J.push(b),x=!0},B.addMarker=function(a,c){c=c||{},c.id=h(c.id),B.clearById(c.id),c.options||(c.options={}),c.options.position=a.getPosition(),j(b,{"td":c},a,c.id),E[c.id]=H.length,F[H.length]=c.id,H.push(a),I.push(c),J.push(c.data||{}),x=!0},B.td=function(a){return I[a]},B.value=function(a){return J[a]},B.marker=function(a){return a in H?(f(a),H[a]):!1},B.markerIsSet=function(a){return Boolean(H[a])},B.setMarker=function(a,b){H[a]=b},B.store=function(a,b,c){D[a.ref]={"obj":b,"shadow":c}},B.free=function(){var b;for(b=0;b<C.length;b++)M.event.removeListener(C[b]);C=[],a.each(D,function(a){i(a)}),D={},a.each(I,function(a){I[a]=null}),I=[],a.each(H,function(a){H[a]&&(H[a].setMap(null),delete H[a])}),H=[],a.each(J,function(a){delete J[a]}),J=[],E={},F={}},B.filter=function(a){t=a,p()},B.enable=function(a){A!==a&&(A=a,p())},B.display=function(a){u=a},B.error=function(a){v=a},B.beginUpdate=function(){w=!0},B.endUpdate=function(){w=!1,x&&p()},B.autofit=function(a){var b;for(b=0;b<I.length;b++)I[b]&&a.extend(I[b].options.position)}}function I(a,b){var c=this;c.id=function(){return a},c.filter=function(a){b.filter(a)},c.enable=function(){b.enable(!0)},c.disable=function(){b.enable(!1)},c.add=function(a,c,d){d||b.beginUpdate(),b.addMarker(a,c),d||b.endUpdate()},c.getById=function(a){return b.getById(a)},c.clearById=function(a,c){var d;return c||b.beginUpdate(),d=b.clearById(a),c||b.endUpdate(),d},c.clear=function(a,c,d,e){e||b.beginUpdate(),b.clear(a,c,d),e||b.endUpdate()}}function J(b,c,d,e){var f=this,g=[];L.classes.OverlayView.call(f),f.setMap(b),f.onAdd=function(){var b=f.getPanes();c.pane in b&&a(b[c.pane]).append(e),a.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(b,c){g.push(M.event.addDomListener(e[0],c,function(b){a.Event(b).stopPropagation(),M.event.trigger(f,c,[b]),f.draw()}))}),g.push(M.event.addDomListener(e[0],"contextmenu",function(b){a.Event(b).stopPropagation(),M.event.trigger(f,"rightclick",[b]),f.draw()}))},f.getPosition=function(){return d},f.setPosition=function(a){d=a,f.draw()},f.draw=function(){var a=f.getProjection().fromLatLngToDivPixel(d);e.css("left",a.x+c.offset.x+"px").css("top",a.y+c.offset.y+"px")},f.onRemove=function(){var a;for(a=0;a<g.length;a++)M.event.removeListener(g[a]);e.remove()},f.hide=function(){e.hide()},f.show=function(){e.show()},f.toggle=function(){e&&(e.is(":visible")?f.show():f.hide())},f.toggleDOM=function(){f.setMap(f.getMap()?null:b)},f.getDOMElement=function(){return e[0]}}function K(e){function g(){!v&&(v=x.get())&&v.run()}function k(){v=null,x.ack(),g.call(w)}function l(a){var b,c=a.td.callback;c&&(b=Array.prototype.slice.call(arguments,1),O(c)?c.apply(e,b):P(c)&&O(c[1])&&c[1].apply(c[0],b))}function o(a,b,c){c&&j(e,a,b,c),l(a,b),v.ack(b)}function q(b,c){c=c||{};var d=c.td&&c.td.options?c.td.options:0;G?d&&(d.center&&(d.center=r(d.center)),G.setOptions(d)):(d=c.opts||a.extend(!0,{},L.map,d||{}),d.center=b||r(d.center),G=new L.classes.Map(e.get(0),d))}function t(c){var d,f,g=new H(e,G,c),h={},i={},k=[],l=/^[0-9]+$/;for(f in c)l.test(f)?(k.push(1*f),i[f]=c[f],i[f].width=i[f].width||0,i[f].height=i[f].height||0):h[f]=c[f];return k.sort(function(a,b){return a>b}),d=h.calculator?function(b){var c=[];return a.each(b,function(a,b){c.push(g.value(b))}),h.calculator.apply(e,[c])}:function(a){return a.length},g.error(function(){n.apply(w,arguments)}),g.display(function(f){var l,m,n,o,p,q,s=d(f.indexes);if(c.force||s>1)for(l=0;l<k.length;l++)k[l]<=s&&(m=i[k[l]]);m?(p=m.offset||[-m.width/2,-m.height/2],n=a.extend({},h),n.options=a.extend({"pane":"overlayLayer","content":m.content?m.content.replace("CLUSTER_COUNT",s):"","offset":{"x":("x"in p?p.x:p[0])||0,"y":("y"in p?p.y:p[1])||0}},h.options||{}),o=w.overlay({"td":n,"opts":n.options,"latLng":r(f)},!0),n.options.pane="floatShadow",n.options.content=a(document.createElement("div")).width(m.width+"px").height(m.height+"px").css({"cursor":"pointer"}),q=w.overlay({"td":n,"opts":n.options,"latLng":r(f)},!0),h.data={"latLng":r(f),"markers":[]},a.each(f.indexes,function(a,b){h.data.markers.push(g.value(b)),g.markerIsSet(b)&&g.marker(b).setMap(null)}),j(e,{"td":h},q,b,{"main":o,"shadow":q}),g.store(f,o,q)):a.each(f.indexes,function(a,b){g.marker(b).setMap(G)})}),g}function u(b,c,d){var f=[],g="values"in b.td;return g||(b.td.values=[{"options":b.opts}]),b.td.values.length?(q(),a.each(b.td.values,function(a,g){var h,i,k,l,n=m(b,g);if(n.options[d])if(n.options[d][0][0]&&P(n.options[d][0][0]))for(i=0;i<n.options[d].length;i++)for(k=0;k<n.options[d][i].length;k++)n.options[d][i][k]=r(n.options[d][i][k]);else for(i=0;i<n.options[d].length;i++)n.options[d][i]=r(n.options[d][i]);n.options.map=G,l=new M[c](n.options),f.push(l),h=y.add({"td":n},c.toLowerCase(),l),j(e,{"td":n},l,h)}),void o(b,g?f:f[0])):void o(b,!1)}var v,w=this,x=new z,y=new A,G=null;w._plan=function(a){var b;for(b=0;b<a.length;b++)x.add(new B(w,k,a[b]));g()},w.map=function(a){q(a.latLng,a),j(e,a,G),o(a,G)},w.destroy=function(a){y.clear(),e.empty(),G&&(G=null),o(a,!0)},w.overlay=function(b,c){var d=[],f="values"in b.td;return f||(b.td.values=[{"latLng":b.latLng,"options":b.opts}]),b.td.values.length?(J.__initialised||(J.prototype=new L.classes.OverlayView,J.__initialised=!0),a.each(b.td.values,function(f,g){var h,i,k=m(b,g),l=a(document.createElement("div")).css({"border":"none","borderWidth":0,"position":"absolute"});l.append(k.options.content),i=new J(G,k.options,r(k)||r(g),l),d.push(i),l=null,c||(h=y.add(b,"overlay",i),j(e,{"td":k},i,h))}),c?d[0]:void o(b,f?d:d[0])):void o(b,!1)},w.marker=function(b){var c,d,f,g="values"in b.td,i=!G;return g||(b.opts.position=b.latLng||r(b.opts.position),b.td.values=[{"options":b.opts}]),b.td.values.length?(i&&q(),b.td.cluster&&!G.getBounds()?void M.event.addListenerOnce(G,"bounds_changed",function(){w.marker.apply(w,[b])}):void(b.td.cluster?(b.td.cluster instanceof I?(d=b.td.cluster,f=y.getById(d.id(),!0)):(f=t(b.td.cluster),d=new I(h(b.td.id,!0),f),y.add(b,"clusterer",d,f)),f.beginUpdate(),a.each(b.td.values,function(a,c){var d=m(b,c);d.options.position=r(d.options.position?d.options.position:c),d.options.position&&(d.options.map=G,i&&(G.setCenter(d.options.position),i=!1),f.add(d,c))}),f.endUpdate(),o(b,d)):(c=[],a.each(b.td.values,function(a,d){var f,g,h=m(b,d);h.options.position=r(h.options.position?h.options.position:d),h.options.position&&(h.options.map=G,i&&(G.setCenter(h.options.position),i=!1),g=new L.classes.Marker(h.options),c.push(g),f=y.add({"td":h},"marker",g),j(e,{"td":h},g,f))}),o(b,g?c:c[0])))):void o(b,!1)},w.getroute=function(a){a.opts.origin=r(a.opts.origin,!0),a.opts.destination=r(a.opts.destination,!0),C().route(a.opts,function(b,c){l(a,c===M.DirectionsStatus.OK?b:!1,c),v.ack()})},w.getdistance=function(a){var b;for(a.opts.origins=p(a.opts.origins),b=0;b<a.opts.origins.length;b++)a.opts.origins[b]=r(a.opts.origins[b],!0);for(a.opts.destinations=p(a.opts.destinations),b=0;b<a.opts.destinations.length;b++)a.opts.destinations[b]=r(a.opts.destinations[b],!0);D().getDistanceMatrix(a.opts,function(b,c){l(a,c===M.DistanceMatrixStatus.OK?b:!1,c),v.ack()})},w.infowindow=function(c){var d=[],g="values"in c.td;g||(c.latLng&&(c.opts.position=c.latLng),c.td.values=[{"options":c.opts}]),a.each(c.td.values,function(a,h){var i,k,l=m(c,h);l.options.position=r(l.options.position?l.options.position:h.latLng),G||q(l.options.position),k=new L.classes.InfoWindow(l.options),k&&(f(l.open)||l.open)&&(g?k.open(G,l.anchor||b):k.open(G,l.anchor||(c.latLng?b:c.session.marker?c.session.marker:b))),d.push(k),i=y.add({"td":l},"infowindow",k),j(e,{"td":l},k,i)}),o(c,g?d:d[0])},w.circle=function(b){var c=[],d="values"in b.td;return d||(b.opts.center=b.latLng||r(b.opts.center),b.td.values=[{"options":b.opts}]),b.td.values.length?(a.each(b.td.values,function(a,d){var f,g,h=m(b,d);h.options.center=r(h.options.center?h.options.center:d),G||q(h.options.center),h.options.map=G,g=new L.classes.Circle(h.options),c.push(g),f=y.add({"td":h},"circle",g),j(e,{"td":h},g,f)}),void o(b,d?c:c[0])):void o(b,!1)},w.getaddress=function(a){l(a,a.results,a.status),v.ack()},w.getlatlng=function(a){l(a,a.results,a.status),v.ack()},w.getmaxzoom=function(a){E().getMaxZoomAtLatLng(a.latLng,function(b){l(a,b.status===M.MaxZoomStatus.OK?b.zoom:!1,status),v.ack()})},w.getelevation=function(a){var b,c=[],d=function(b,c){l(a,c===M.ElevationStatus.OK?b:!1,c),v.ack()};if(a.latLng)c.push(a.latLng);else for(c=p(a.td.locations||[]),b=0;b<c.length;b++)c[b]=r(c[b]);if(c.length)F().getElevationForLocations({"locations":c},d);else{if(a.td.path&&a.td.path.length)for(b=0;b<a.td.path.length;b++)c.push(r(a.td.path[b]));c.length?F().getElevationAlongPath({"path":c,"samples":a.td.samples},d):v.ack()}},w.defaults=function(b){a.each(b.td,function(b,d){L[b]=c(L[b])?a.extend({},L[b],d):d}),v.ack(!0)},w.rectangle=function(b){var c=[],d="values"in b.td;return d||(b.td.values=[{"options":b.opts}]),b.td.values.length?(a.each(b.td.values,function(a,d){var f,g,h=m(b,d);h.options.bounds=s(h.options.bounds?h.options.bounds:d),G||q(h.options.bounds.getCenter()),h.options.map=G,g=new L.classes.Rectangle(h.options),c.push(g),f=y.add({"td":h},"rectangle",g),j(e,{"td":h},g,f)}),void o(b,d?c:c[0])):void o(b,!1)},w.polyline=function(a){u(a,"Polyline","path")},w.polygon=function(a){u(a,"Polygon","paths")},w.trafficlayer=function(a){q();var b=y.get("trafficlayer");b||(b=new L.classes.TrafficLayer,b.setMap(G),y.add(a,"trafficlayer",b)),o(a,b)},w.bicyclinglayer=function(a){q();var b=y.get("bicyclinglayer");b||(b=new L.classes.BicyclingLayer,b.setMap(G),y.add(a,"bicyclinglayer",b)),o(a,b)},w.groundoverlay=function(a){a.opts.bounds=s(a.opts.bounds),a.opts.bounds&&q(a.opts.bounds.getCenter());var b,c=new L.classes.GroundOverlay(a.opts.url,a.opts.bounds,a.opts.opts);c.setMap(G),b=y.add(a,"groundoverlay",c),o(a,c,b)},w.streetviewpanorama=function(b){b.opts.opts||(b.opts.opts={}),b.latLng?b.opts.opts.position=b.latLng:b.opts.opts.position&&(b.opts.opts.position=r(b.opts.opts.position)),b.td.divId?b.opts.container=document.getElementById(b.td.divId):b.opts.container&&(b.opts.container=a(b.opts.container).get(0));var c,d=new L.classes.StreetViewPanorama(b.opts.container,b.opts.opts);d&&G.setStreetView(d),c=y.add(b,"streetviewpanorama",d),o(b,d,c)},w.kmllayer=function(b){var c=[],d="values"in b.td;return d||(b.td.values=[{"options":b.opts}]),b.td.values.length?(a.each(b.td.values,function(a,d){var f,g,h,k=m(b,d);G||q(),h=k.options,k.options.opts&&(h=k.options.opts,k.options.url&&(h.url=k.options.url)),h.map=G,g=i("3.10")?new L.classes.KmlLayer(h):new L.classes.KmlLayer(h.url,h),c.push(g),f=y.add({"td":k},"kmllayer",g),j(e,{"td":k},g,f)}),void o(b,d?c:c[0])):void o(b,!1)},w.panel=function(b){q();var c,d,g=0,h=0,i=a(document.createElement("div"));i.css({"position":"absolute","zIndex":1e3,"visibility":"hidden"}),b.opts.content&&(d=a(b.opts.content),i.append(d),e.first().prepend(i),f(b.opts.left)?f(b.opts.right)?b.opts.center&&(g=(e.width()-d.width())/2):g=e.width()-d.width()-b.opts.right:g=b.opts.left,f(b.opts.top)?f(b.opts.bottom)?b.opts.middle&&(h=(e.height()-d.height())/2):h=e.height()-d.height()-b.opts.bottom:h=b.opts.top,i.css({"top":h,"left":g,"visibility":"visible"})),c=y.add(b,"panel",i),o(b,i,c),i=null},w.directionsrenderer=function(b){b.opts.map=G;var c,d=new M.DirectionsRenderer(b.opts);b.td.divId?d.setPanel(document.getElementById(b.td.divId)):b.td.container&&d.setPanel(a(b.td.container).get(0)),c=y.add(b,"directionsrenderer",d),o(b,d,c)},w.getgeoloc=function(a){o(a,a.latLng)},w.styledmaptype=function(a){q();var b=new L.classes.StyledMapType(a.td.styles,a.opts);G.mapTypes.set(a.td.id,b),o(a,b)},w.imagemaptype=function(a){q();var b=new L.classes.ImageMapType(a.opts);G.mapTypes.set(a.td.id,b),o(a,b)},w.autofit=function(b){var c=new M.LatLngBounds;a.each(y.all(),function(a,b){b.getPosition?c.extend(b.getPosition()):b.getBounds?(c.extend(b.getBounds().getNorthEast()),c.extend(b.getBounds().getSouthWest())):b.getPaths?b.getPaths().forEach(function(a){a.forEach(function(a){c.extend(a)})}):b.getPath?b.getPath().forEach(function(a){c.extend(a)}):b.getCenter?c.extend(b.getCenter()):"function"==typeof I&&b instanceof I&&(b=y.getById(b.id(),!0),b&&b.autofit(c))}),c.isEmpty()||G.getBounds()&&G.getBounds().equals(c)||("maxZoom"in b.td&&M.event.addListenerOnce(G,"bounds_changed",function(){this.getZoom()>b.td.maxZoom&&this.setZoom(b.td.maxZoom)}),G.fitBounds(c)),o(b,!0)},w.clear=function(b){if(d(b.td)){if(y.clearById(b.td)||y.objClearById(b.td))return void o(b,!0);b.td={"name":b.td}}b.td.id?a.each(p(b.td.id),function(a,b){y.clearById(b)||y.objClearById(b)}):(y.clear(p(b.td.name),b.td.last,b.td.first,b.td.tag),y.objClear(p(b.td.name),b.td.last,b.td.first,b.td.tag)),o(b,!0)},w.get=function(c,e,f){var g,h,i=e?c:c.td;return e||(f=i.full),d(i)?(h=y.getById(i,!1,f)||y.objGetById(i),h===!1&&(g=i,i={})):g=i.name,"map"===g&&(h=G),h||(h=[],i.id?(a.each(p(i.id),function(a,b){h.push(y.getById(b,!1,f)||y.objGetById(b))}),P(i.id)||(h=h[0])):(a.each(g?p(g):[b],function(b,c){var d;i.first?(d=y.get(c,!1,i.tag,f),d&&h.push(d)):i.all?a.each(y.all(c,i.tag,f),function(a,b){h.push(b)}):(d=y.get(c,!0,i.tag,f),d&&h.push(d))}),i.all||P(g)||(h=h[0]))),h=P(h)||!i.all?h:[h],e?h:void o(c,h)},w.exec=function(b){a.each(p(b.td.func),function(c,d){a.each(w.get(b.td,!0,b.td.hasOwnProperty("full")?b.td.full:!0),function(a,b){d.call(e,b)})}),o(b,!0)},w.trigger=function(b){if(d(b.td))M.event.trigger(G,b.td);else{var c=[G,b.td.eventName];b.td.var_args&&a.each(b.td.var_args,function(a,b){c.push(b)}),M.event.trigger.apply(M.event,c)}l(b),v.ack()}}var L,M,N=0,O=a.isFunction,P=a.isArray,Q={},R=new y;a.fn.gmap3=function(){var b,c=[],d=!0,e=[];for(g(),b=0;b<arguments.length;b++)arguments[b]&&c.push(arguments[b]);return c.length||c.push("map"),a.each(this,function(){var b=a(this),f=b.data("gmap3");d=!1,f||(f=new K(b),b.data("gmap3",f)),1!==c.length||"get"!==c[0]&&!w(c[0])?f._plan(c):e.push("get"===c[0]?f.get("map",!0):f.get(c[0].get,!0,c[0].get.full))}),e.length?1===e.length?e[0]:e:this}}(jQuery);