Ubuntu
/*!
* GMAP3 Plugin for JQuery
* Version : 5.1.1
* Date : 2013-05-25
* Licence : GPL v3 : http://www.gnu.org/licenses/gpl.html
* Author : DEMONTE Jean-Baptiste
* Contact : jbdemonte@gmail.com
* Web site : http://gmap3.net
*
* Copyright (c) 2010-2012 Jean-Baptiste DEMONTE
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* - Neither the name of the author nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
!function(t,o){function e(){E||(E={verbose:!1,queryLimit:{attempt:5,delay:250,random:250},classes:{Map:google.maps.Map,Marker:google.maps.Marker,InfoWindow:google.maps.InfoWindow,Circle:google.maps.Circle,Rectangle:google.maps.Rectangle,OverlayView:google.maps.OverlayView,StreetViewPanorama:google.maps.StreetViewPanorama,KmlLayer:google.maps.KmlLayer,TrafficLayer:google.maps.TrafficLayer,BicyclingLayer:google.maps.BicyclingLayer,GroundOverlay:google.maps.GroundOverlay,StyledMapType:google.maps.StyledMapType,ImageMapType:google.maps.ImageMapType},map:{mapTypeId:google.maps.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 n(t,e){return t!==o?t:"gmap3_"+(e?A+1:++A)}function i(t){var o,e=function(t){return parseInt(t,10)},n=google.maps.version.split(".").map(e);for(t=t.split(".").map(e),o=0;oi.maxZoom,O=p(),C=!1;for(M=!1,P>3&&(r=c(),C=r.getSouthWest().lng()1&&m)}else for(n=o;n=0&&(i=s[t][n],!o(a[i].tag));n--);else for(n=0;n=0||!o.length))for(var r in s.clusterer)a[s.clusterer[r]].obj.clear(e,n,i)}}function m(){return _.geocoder||(_.geocoder=new google.maps.Geocoder),_.geocoder}function y(){return _.directionsService||(_.directionsService=new google.maps.DirectionsService),_.directionsService}function w(){return _.elevationService||(_.elevationService=new google.maps.ElevationService),_.elevationService}function L(){return _.maxZoomService||(_.maxZoomService=new google.maps.MaxZoomService),_.maxZoomService}function b(){return _.distanceMatrixService||(_.distanceMatrixService=new google.maps.DistanceMatrixService),_.distanceMatrixService}function M(){if(E.verbose){var t,o=[];if(window.console&&"function"==typeof console.error){for(t=0;t=0)return!0;return!1}return t.inArray(n,e)>=0}):void 0}function B(o,e,n){var i=e?o:null;return o&&"string"!=typeof o?o.latLng?B(o.latLng):o instanceof google.maps.LatLng?o:x(o.lat)?new google.maps.LatLng(o.lat,o.lng):!n&&t.isArray(o)&&x(o[0])&&x(o[1])?new google.maps.LatLng(o[0],o[1]):i:i}function P(o){var e,n;return!o||o instanceof google.maps.LatLngBounds?o||null:(t.isArray(o)?2==o.length?(e=B(o[0]),n=B(o[1])):4==o.length&&(e=B([o[0],o[1]]),n=B([o[2],o[3]])):"ne"in o&&"sw"in o?(e=B(o.ne),n=B(o.sw)):"n"in o&&"e"in o&&"s"in o&&"w"in o&&(e=B([o.n,o.e]),n=B([o.s,o.w])),e&&n?new google.maps.LatLngBounds(n,e):null)}function S(t,o,e,n,i){var s=e?B(n.todo,!1,!0):!1,a=s?{latLng:s}:n.todo.address?"string"==typeof n.todo.address?{address:n.todo.address}:n.todo.address:!1,r=a?D.get(a):!1,l=this;a?(i=i||0,r?(n.latLng=r.results[0].geometry.location,n.results=r.results,n.status=r.status,o.apply(t,[n])):(a.location&&(a.location=B(a.location)),a.bounds&&(a.bounds=P(a.bounds)),m().geocode(a,function(s,r){r===google.maps.GeocoderStatus.OK?(D.store(a,{results:s,status:r}),n.latLng=s[0].geometry.location,n.results=s,n.status=r,o.apply(t,[n])):r===google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&i=o.length?void n.apply(e,[i]):void S(a,function(e){delete e.todo,t.extend(o[r],e),s.apply(a,[])},!0,{todo:o[r]})}var a=this,r=-1;s()}function O(t,o,e){var n=!1;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){n||(n=!0,e.latLng=new google.maps.LatLng(i.coords.latitude,i.coords.longitude),o.apply(t,[e]))},function(){n||(n=!0,e.latLng=!1,o.apply(t,[e]))},e.opts.getCurrentPosition):(e.latLng=!1,o.apply(t,[e]))}function C(e){function l(){!S&&(S=O.get())&&S.run()}function c(){S=null,O.ack(),l.call(j)}function p(o){if(o.todo.callback){var n=Array.prototype.slice.call(arguments,1);"function"==typeof o.todo.callback?o.todo.callback.apply(e,n):t.isArray(o.todo.callback)&&"function"==typeof o.todo.callback[1]&&o.todo.callback[1].apply(o.todo.callback[0],n)}}function g(t,o,n){n&&s(e,t,o,n),p(t,o),S.ack(o)}function m(o,n){if(n=n||{},T)n.todo&&n.todo.options&&(n.todo.options.center&&(n.todo.options.center=B(n.todo.options.center)),T.setOptions(n.todo.options));else{var i=n.opts||t.extend(!0,{},E.map,n.todo&&n.todo.options?n.todo.options:{});i.center=o||B(i.center),T=new E.classes.Map(e.get(0),i)}}function x(o,n,i){var a=[],r="values"in o.todo;return r||(o.todo.values=[{options:o.opts}]),o.todo.values.length?(m(),t.each(o.todo.values,function(r,l){var c,p,d,g,f=u(o,l);if(f.options[i])if(f.options[i][0][0]&&t.isArray(f.options[i][0][0]))for(p=0;po}),i=l.calculator?function(o){var n=[];return t.each(o,function(t,o){n.push(r.value(o))}),l.calculator.apply(e,[n])}:function(t){return t.length},r.error(function(){M.apply(j,arguments)}),r.display(function(a){var p,d,g,f,h,v=i(a.indexes);if(n.force||v>1)for(p=0;po.todo.maxZoom&&this.setZoom(o.todo.maxZoom)}),T.fitBounds(e)),g(o,!0)},this.clear=function(o){if("string"==typeof o.todo){if(C.clearById(o.todo)||C.objClearById(o.todo))return void g(o,!0);o.todo={name:o.todo}}o.todo.id?t.each(k(o.todo.id),function(t,o){C.clearById(o)||C.objClearById(o)}):(C.clear(k(o.todo.name),o.todo.last,o.todo.first,o.todo.tag),C.objClear(k(o.todo.name),o.todo.last,o.todo.first,o.todo.tag)),g(o,!0)},this.exec=function(o){var n=this;t.each(k(o.todo.func),function(i,s){t.each(n.get(o.todo,!0,o.todo.hasOwnProperty("full")?o.todo.full:!0),function(t,o){s.call(e,o)})}),g(o,!0)},this.get=function(e,n,i){var s,a,r=n?e:e.todo;return n||(i=r.full),"string"==typeof r?(a=C.getById(r,!1,i)||C.objGetById(r),a===!1&&(s=r,r={})):s=r.name,"map"===s&&(a=T),a||(a=[],r.id?(t.each(k(r.id),function(t,o){a.push(C.getById(o,!1,i)||C.objGetById(o))}),t.isArray(r.id)||(a=a[0])):(t.each(s?k(s):[o],function(o,e){var n;r.first?(n=C.get(e,!1,r.tag,i),n&&a.push(n)):r.all?t.each(C.all(e,r.tag,i),function(t,o){a.push(o)}):(n=C.get(e,!0,r.tag,i),n&&a.push(n))}),r.all||t.isArray(s)||(a=a[0]))),a=t.isArray(a)||!r.all?a:[a],n?a:void g(e,a)},this.getdistance=function(t){var o;for(t.opts.origins=k(t.opts.origins),o=0;o