source: oceandb/jQuery_Prototype/script/gzoom.js @ 113

Last change on this file since 113 was 111, checked in by rider, 15 years ago

Javascript library: gzoom

File size: 8.0 KB
Line 
1/*
2Copyright (c) 2005-2006, Andre Lewis, andre@earthcode.com
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification, are permitted provided
6that the following conditions are met:
7
8    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9    * 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.
10    * Neither the name of "Andre Lewis" nor the names of contributors to this software may be used to endorse or promote products derived from this software without specific prior written permission.
11
12THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
13IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
14FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
15CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
19ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20*/
21/*
22GZoom custom map control. Version 0.2 Released 11/21/06
23
24To use:
25  oMap = new GMap2($id("large-google-map")); 
26  oMap.addControl(new GMapTypeControl());
27
28Or with options:
29  oMap.addControl(new GZoomControl({sColor:'#000',nOpacity:.3,sBorder:'1px solid yellow'}), new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,10)));
30
31More info at http://earthcode.com
32*/
33eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 6(26,24,1q){6.G.5={1b:.2,1K:"#4c",1O:"4b 2W 4a"};7 5=6.G.5;W(7 s 1u 26){5[s]=26[s]};7 25=5.1O.29(\' \');5.1X=1H(25[0].49(/\\D/g,\'\'));5.2y=25[2];5.1D=\'2H(X=\'+(5.1b*2G)+\')\';6.G.y={2s:T,23:\'2n ...\',2U:{I:\'48\',2r:\'1m 2W 47\',46:\'1f 2V 1m 2V\'},22:{11:\'#45\'},2R:\'44 a 43 42 41 20\',2Q:{11:\'#40\'},2x:3Z,2t:T};W(7 s 1u 24){6.G.y[s]=24[s]};d(1q==x){1q={}};6.G.H=1q}6.8=J 3Y();6.G={14:T,F:x,B:x,v:x,C:x,Z:x,L:x,13:0,12:0,1g:0,h:0,f:0,15:0};6.8.2P=9(2T){7 G=6.G;7 m=w.2O(\'z\');m.1p=G.y.23;m.j=\'q-1Y\';b.5([m],{2N:\'3X\',2M:3W});b.5([m],G.y.2U);b.5([m],G.y.22);2T.2L(m);A m};6.8.1C=9(2S){7 G=6.G;d(2S==\'2p\'){G.m.1p=G.y.2R;b.5([G.m],G.y.2Q)}1A{G.m.1p=G.y.23;b.5([G.m],G.y.22)}};6.8.3V=9(k){7 G=6.G;7 21=k.1M();7 m=1Z.2P(21);7 o=w.2O("z");o.j=\'q-20-2J\';o.1p=\'<z j="q-2K" 5="V:U;n:K;"></z><z j="q-F" 5="V:U;n:K;"></z><z j="q-C" 5="V:U;n:K;"></z><z j="q-B" 5="V:U;n:K;"></z><z j="q-v" 5="V:U;n:K;"></z>\';b.5([o],{V:\'U\',n:\'K\',3U:\'3T\',2N:\'3S\',2M:3R});21.2L(o);1o.1n(m,\'3Q\',6.8.2q);1o.1n(o,\'3P\',6.8.2I);1o.1n(w,\'3O\',6.8.2D);1o.1n(w,\'3N\',6.8.2B);G.Z=b.1x(k.1M());G.L=$j("q-2K");G.m=$j("q-1Y");G.M=$j("q-20-2J");G.F=$j("q-F");G.B=$j("q-B");G.v=$j("q-v");G.C=$j("q-C");G.k=k;G.15=G.5.1X*2;1Z.1L();1Z.1N();E("3M 3L q 1Y");A m};6.8.3K=9(){A J 3J(3I,J 3H(3,3G))};6.8.2I=9(e){7 G=6.G;7 p=6.8.1d(e);E("3F 2E 2z "+p.u+", "+p.r);G.h=p.u;G.f=p.r;b.5([G.M],{11:\'3E\',X:1,1E:\'2H(X=2G)\'});b.5([G.L],{u:G.h+\'l\',r:G.f+\'l\',n:\'N\',I:\'1m\',10:\'1m\'});G.14=2k;G.F.5.r=(G.f-G.12)+\'l\';G.F.5.n=\'N\';G.C.5.u=(G.h-G.13)+\'l\';G.C.5.r=(G.f)+\'l\';G.C.5.n=\'N\';G.B.5.u=(G.h)+\'l\';G.B.5.r=(G.f)+\'l\';G.B.5.n=\'N\';G.v.5.u=(G.h)+\'l\';G.v.5.r=(G.f)+\'l\';G.v.5.I=\'1f\';G.v.5.n=\'N\';d(G.H.2F!=x){G.H.2F(G.h,G.f)};E("2A 2E 1a");A T};6.8.2D=9(e){7 G=6.G;d(G.14){7 p=6.8.1d(e);c=6.8.1J(G.h,G.f,p,G.1g);G.L.5.I=c.1c+"l";G.L.5.10=c.1I+"l";G.B.5.u=(c.Q+G.15)+\'l\';G.v.5.r=(c.P+G.15)+\'l\';G.v.5.I=(c.1c+G.15)+\'l\';d(G.H.2C!=x){G.H.2C(G.h,G.f,c.Q,c.P)};A T}};6.8.2B=9(e){7 G=6.G;d(G.14){7 p=6.8.1d(e);G.14=T;7 c=6.8.1J(G.h,G.f,p,G.1g);E("2A 3D 2z "+c.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.M,G.F,G.B,G.v,G.C],{n:\'K\',X:G.5.1b,1E:G.5.1D});G.L.5.n=\'K\';6.8.1C(\'3l\');E("1a 3k 3j 3i 2n")};9 $j(2m){A w.3h(2m)}d(!1B[\'2l\']){7 b={};1B[\'2l\']=2k}b.2j=9(e){7 18=0;7 17=0;d(!e)7 e=1B.3g;d(e.2i||e.2h){18=e.2i;17=e.2h}1A d(e.2g||e.2f){18=e.2g+(w.19.1z?w.19.1z:w.2e.1z);17=e.2f+(w.19.1y?w.19.1y:w.2e.1y)}A{u:18,r:17}};b.1x=9(16){7 1w=16.2d;7 1v=16.2c;7 O=16.2b;3f(O!=x){1w+=O.2d;1v+=O.2c;O=O.2b}A{u:1w,r:1v}};b.5=9(a,o){d(3e(a)==\'3d\'){a=b.2a(a)}W(7 i=0;i<a.1t;i++){W(7 s 1u o){a[i].5[s]=o[s]}}};b.2a=9(s){t=s.29(\',\');a=[];W(7 i=0;i<t.1t;i++){a[a.1t]=$j(t[i])};A a};7 1r={E:9(){},3c:9(){},3b:9(){},1s:9(){},28:9(){}};7 E=9(){};d(3a.39.38(/37/)){w.36(\'<27 35="28/34" 33="32://31.30/2Z/2Y/1r.2X"></27>\')};',62,261,'|||||style|GZoomControl|var|prototype|function||acl|oRec|if||nStartY||nStartX||id|oMap|px|oButton|display||oPos|gzoom|top|||left|mcb|document|null|options|div|return|mcr|mcl||debug|mct||callbacks|width|new|none|oOutline|mc|block|eParElement|nEndY|nEndX|dY|dX|false|absolute|position|for|opacity|delta|oMapPos|height|background|nMapHeight|nMapWidth|bDragging|nBorderCorrect|eElement|posy|posx|documentElement|done|nOpacity|nWidth|getRelPos_|initCover_|0px|nMapRatio|sw|ne|nw|fromContainerPixelToLatLng|GPoint|1px|addDomListener|GEvent|innerHTML|oCallbacks|jslog|error|length|in|nTopPos|nLeftPos|getElementPosition|scrollTop|scrollLeft|else|window|setButtonMode_|sIEAlpha|filter|resetDragZoom_|nRatio|parseInt|nHeight|getRectangle_|sColor|setDimensions_|getContainer|initStyles_|sBorder|oSize|swpx|sepx|nepx|nwpx|se|oBounds|oZoomArea|nOutlineWidth|control|this|map|oMC|oButtonStyle|sButtonHTML|oOptions|aStyle|oBoxStyle|script|text|split|getManyElements|offsetParent|offsetTop|offsetLeft|body|clientY|clientX|pageY|pageX|getMousePosition|true|acldefined|sId|zoom|buttonClick|zooming|buttonClick_|border|bForceCheckResize|bStickyZoom|dragEnd|nZoom|oCenter|nOverlayRemoveMS|sOutlineColor|at|mouse|mouseup_|dragging|drag_|down|dragStart|100|alpha|coverMousedown_|cover|outline|appendChild|zIndex|cursor|createElement|initButton_|oButtonZoomingStyle|sButtonZoomingHTML|sMode|oMapContainer|oButtonStartingStyle|5px|solid|js|scripts|includes|com|earthcode|http|src|javascript|type|write|enablejslog|match|href|location|warning|info|string|typeof|while|event|getElementById|drag|reset|with|normal|getSize|checkResize|setCenter|getCenter|getBoundsZoomLevel|GLatLngBounds|message|overlay|zoomarea|adding|catch|removeOverlay|setTimeout|addOverlay|try|GPolyline|Height|up|transparent|Mouse|120|GSize|G_ANCHOR_TOP_LEFT|GControlPosition|getDefaultPosition|Initializing|Finished|mouseup|mousemove|mousedown|click|101|crosshair|hidden|overflow|initialize|200|pointer|GControl|6000|FF0|the|on|region|Drag|FFF|padding|black|52px|replace|blue|2px|000'.split('|'),0,{}))
34
Note: See TracBrowser for help on using the repository browser.