Commit 418d5a27792ee9f6417626e2efce86dd81057941

Authored by Edmar Moretti
1 parent 8adef9fb

V6 - inclusão da biblioteca geohash-js-master em i3geo/pacotes

ferramentas/salvamapa/dicionario.js
... ... @@ -67,7 +67,7 @@ i3GEOF.salvaMapa.dicionario = {
67 67 it:""
68 68 }],
69 69 12: [{
70   - pt:"fazendo o download. Isso permitirá que você faça o upload desse mesmo arquivo, restaurando o mapa.",
  70 + pt:"fazendo o download. Isso permitirá que você faça o upload desse mesmo arquivo, restaurando o mapa.",
71 71 en:"",
72 72 es:"",
73 73 it:""
... ... @@ -79,7 +79,7 @@ i3GEOF.salvaMapa.dicionario = {
79 79 it:""
80 80 }],
81 81 14: [{
82   - pt:"Faça login e cadastre o mapa atual no banco de dados existente no servidor web. Com isso o mapa será salvo de forma permanente e outros usuários poderão utilizá-lo. Consulte o admnistrador do site que você está utilizando para saber mais sobre a política de uso do mapa que for salvo",
  82 + pt:"Faça login e cadastre o mapa atual no banco de dados existente no servidor web. Com isso o mapa será salvo de forma permanente e outros usuários poder�o utilizá-lo. Consulte o admnistrador do site que voc� est� utilizando para saber mais sobre a política de uso do mapa que for salvo",
83 83 en:"",
84 84 es:"",
85 85 it:""
... ...
ferramentas/salvamapa/index.js
... ... @@ -121,7 +121,6 @@ i3GEOF.salvaMapa = {
121 121 }
122 122 },
123 123 salvaMapaBanco: function(){
124   - //TODO melhorar essa interface
125 124 var texto,funcaoOK,login = i3GEO.login.verificaCookieLogin();
126 125 if(login === false){
127 126 i3GEO.login.dialogo.abreLogin();
... ... @@ -147,9 +146,9 @@ i3GEOF.salvaMapa = {
147 146 }
148 147 }
149 148 };
150   - i3GEO.php.salvaMapaBanco(temp,titulo,id_mapa,true,true);
  149 + i3GEO.php.salvaMapaBanco(temp,titulo,id_mapa,$i("i3GEOFsalvaPref").checked,true);
151 150 };
152   - texto = $trad(7,i3GEOF.salvaMapa.dicionario)+"<br><div id=i3GEOFsalvamapaMapa ></div><br><br>"+$trad(15,i3GEOF.salvaMapa.dicionario);
  151 + texto = $trad(7,i3GEOF.salvaMapa.dicionario)+"<br><div id=i3GEOFsalvamapaMapa ></div><br><br><input style='position:relative;top:2px;' checked type=checkbox id=i3GEOFsalvaPref />"+$trad(15,i3GEOF.salvaMapa.dicionario);
153 152 i3GEO.janela.prompt(texto + "<br><br>"+$trad(8,i3GEOF.salvaMapa.dicionario),funcaoOK);
154 153 i3GEOF.salvaMapa.comboMapas("i3GEOFsalvamapaMapa");
155 154 }
... ...
pacotes/geohash-js-master/README 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +Geohash Javascript Demonstration
  2 +(c) 2008 David Troy
  3 +Released under the MIT License
  4 +
  5 +SUMMARY
  6 +This is a basic demonstration of how the GeoHash algorithm can be used to generate bounding box searches without the use of specialized spatial indexing approaches.
  7 +
  8 +This can be especially helpful in cases where spatial indexes are either not supported or do not scale to high volumes. Environments such as Google App Engine, EC2, and SQLite provide reasonable string indexing services but do not support spatial indexing. This algorithm could be used to provide proximity searching in these environments.
  9 +
  10 +BACKGROUND
  11 +The Geohash algorithm was first described by Gustavo Niemeyer in February 2008. By interleaving latitude and longitude information in a bitwise fashion, a composite value is generated that provides a high resolution geographic point, and is well suited for storage or transmission as a character string.
  12 +
  13 +Geohash also has the property that as the number of digits decreases (from the right), accuracy degrades. This property can be used to do bounding box searches, as points near to one another will share similar Geohash prefixes.
  14 +
  15 +However, because a given point may appear at the edge of a given Geohash bounding box, it is necessary to generate a list of Geohash values in order to perform a true proximity search around a point. Because the Geohash algorithm uses a base-32 numbering system, it is possible to derive the Geohash values surrounding any other given Geohash value using a simple lookup table.
  16 +
  17 +So, for example, 1600 Pennsylvania Avenue, Washington DC resolves to:
  18 +38.897, -77.036
  19 +
  20 +Using the geohash algorithm, this latitude and longitude is converted to:
  21 +dqcjqcp84c6e
  22 +
  23 +A simple bounding box around this point could be described by truncating this geohash to:
  24 +dqcjqc
  25 +
  26 +However, 'dqcjqcp84c6e' is not centered inside 'dqcjqc', and searching within 'dqcjqc' may miss some desired targets.
  27 +
  28 +So instead, we can use the mathematical properties of the Geohash to quickly calculate the neighbors of 'dqcjqc'; we find that they are:
  29 +'dqcjqf','dqcjqb','dqcjr1','dqcjq9','dqcjqd','dqcjr4','dqcjr0','dqcjq8'
  30 +
  31 +This gives us a bounding box around 'dqcjqcp84c6e' roughly 2km x 1.5km and allows for a database search on just 9 keys:
  32 +SELECT * FROM table WHERE LEFT(geohash,6) IN ('dqcjqc', 'dqcjqf','dqcjqb','dqcjr1','dqcjq9','dqcjqd','dqcjr4','dqcjr0','dqcjq8');
  33 +
  34 +MORE INFORMATION
  35 +GeoHash on Wikipedia (http://en.wikipedia.org/wiki/Geohash)
  36 +GeoHash gem on Rubyforge (http://geohash.rubyforge.org/)
  37 +
  38 +THIS PROJECT
  39 +Demo Site (http://openlocation.org/geohash/geohash-js)
  40 +Source Code (http://github.com/davetroy/geohash-js/tree/master)
  41 +
  42 +Please contact me at dave at roundhousetech.com with any questions you may have about this code; right now this is experimental. The bounding box code found here will be added to the Ruby gem soon.
  43 +
... ...
pacotes/geohash-js-master/geohash-demo.js 0 → 100644
... ... @@ -0,0 +1,178 @@
  1 +// geohash.js
  2 +// Geohash library for Javascript
  3 +// (c) 2008 David Troy
  4 +// Code is available for free distribution under the MIT License
  5 +
  6 +function GScript(src) {document.write('<' + 'script src="' + src + '"' +' type="text/javascript"><' + '/script>');}
  7 +
  8 +if (window.location.toString().substr(0,4)=='file')
  9 + var key = "ABQIAAAAS-9BXlmhAxzk5tMQ6009tBQ60YHOa08tQ3Rk7kk6p9CpE9bRLhRgOlUOLYUPHsGwp_XgmEwZWB1hnA";
  10 +else
  11 + var key = "ABQIAAAAS-9BXlmhAxzk5tMQ6009tBSuPyGFyYqpbBL0yyePbwJ9Yzj2TRSRG70K1wsky3JHARggI0ccbJ3Y0A";
  12 +
  13 +GScript('http://maps.google.com/maps?file=api&amp;v=2&amp;key=' + key);
  14 +GScript('./geohash.js');
  15 +GScript('./labeledmarker.js');
  16 +
  17 +var ZOOMLEVELS = { 3: 7, 4 : 10, 5 : 12, 6 : 15, 7 : 17, 8 : 17 };
  18 +
  19 +function getWindowDimensions () {
  20 + var myWidth = 0, myHeight = 0;
  21 + if(typeof(window.innerWidth) == 'number')
  22 + {
  23 + myWidth = window.innerWidth;
  24 + myHeight = window.innerHeight;
  25 + }
  26 + else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
  27 + {
  28 + myWidth = document.documentElement.clientWidth;
  29 + myHeight = document.documentElement.clientHeight;
  30 + }
  31 + else if(document.body && (document.body.clientWidth || document.body.clientHeight))
  32 + {
  33 + myWidth = document.body.clientWidth;
  34 + myHeight = document.body.clientHeight;
  35 + }
  36 +
  37 + return {'width' : myWidth, 'height' : myHeight};
  38 +}
  39 +
  40 +function wheelZoom(a) { (a.detail || -a.wheelDelta) < 0 ? map.zoomIn() : map.zoomOut(); }
  41 +
  42 +function sizeMap() {
  43 + var dims = getWindowDimensions();
  44 + var mapdiv = document.getElementById("map");
  45 + mapdiv.style.height = dims.height-120;
  46 + mapdiv.style.width = dims.width;
  47 +
  48 + var headerdiv = document.getElementById("header");
  49 + headerdiv.style.width = dims.width-30;
  50 +
  51 + var creditsdiv = document.getElementById("credits");
  52 + creditsdiv.style.left = dims.width-180;
  53 +
  54 + map = new GMap2(mapdiv);
  55 + map.setCenter(new GLatLng(39.024,-76.51), 9);
  56 + map.addControl(new GSmallMapControl());
  57 +}
  58 +
  59 +GeoHashBox.prototype.centerMap = function () {
  60 + map.setCenter(this.centerPoint, ZOOMLEVELS[this.geohash.length]);
  61 +}
  62 +
  63 +GeoHashBox.prototype.showNeighbors = function () {
  64 + var geohashPrefix = this.geohash.substr(0,this.geohash.length-1);
  65 +
  66 + this.neighbors.top = new GeoHashBox(calculateAdjacent(this.geohash, 'top'));
  67 + this.neighbors.bottom = new GeoHashBox(calculateAdjacent(this.geohash, 'bottom'));
  68 + this.neighbors.right = new GeoHashBox(calculateAdjacent(this.geohash, 'right'));
  69 + this.neighbors.left = new GeoHashBox(calculateAdjacent(this.geohash, 'left'));
  70 + this.neighbors.topleft = new GeoHashBox(calculateAdjacent(this.neighbors.left.geohash, 'top'));
  71 + this.neighbors.topright = new GeoHashBox(calculateAdjacent(this.neighbors.right.geohash, 'top'));
  72 + this.neighbors.bottomright = new GeoHashBox(calculateAdjacent(this.neighbors.right.geohash, 'bottom'));
  73 + this.neighbors.bottomleft = new GeoHashBox(calculateAdjacent(this.neighbors.left.geohash, 'bottom'));
  74 +}
  75 +
  76 +GeoHashBox.prototype.plot = function () {
  77 + var polyline = new GPolygon([
  78 + this.corners.topleft,
  79 + this.corners.topright,
  80 + this.corners.bottomright,
  81 + this.corners.bottomleft,
  82 + this.corners.topleft
  83 + ], "#007799", 3, 0.7, "#003366", 0.5, {geodesic:true});
  84 + map.addOverlay(polyline);
  85 + var marker = new LabeledMarker(new GLatLng(this.box.latitude[2],this.box.longitude[2]), this.options );
  86 + map.addOverlay(marker);
  87 +}
  88 +
  89 +function GeoHashBox (geohash) {
  90 + this.geohash = geohash;
  91 + this.box = decodeGeoHash(geohash);
  92 + this.corners = {};
  93 + this.corners.topleft = new GLatLng(this.box.latitude[0], this.box.longitude[0]);
  94 + this.corners.topright = new GLatLng(this.box.latitude[1], this.box.longitude[0]);
  95 + this.corners.bottomright = new GLatLng(this.box.latitude[1], this.box.longitude[1]);
  96 + this.corners.bottomleft = new GLatLng(this.box.latitude[0], this.box.longitude[1]);
  97 + this.centerPoint = new GLatLng((this.box.latitude[0] + this.box.latitude[1])/2, (this.box.longitude[0] + this.box.longitude[1])/2);
  98 +
  99 + this.options = {labelText : geohash};
  100 + var lastChr = this.geohash.charAt(this.geohash.length-1);
  101 + this.selfPos = BASE32.indexOf(lastChr);
  102 + this.neighbors = {};
  103 + this.plot();
  104 +}
  105 +
  106 +function geocodeAddress () {
  107 + var address = document.getElementById("address").value;
  108 + var geocoder = new GClientGeocoder();
  109 + geocoder.getLatLng(address, plotGeoHash);
  110 +}
  111 +
  112 +function plotGeoHash (gLatLng) {
  113 + if (gLatLng==null) {
  114 + setText('boxList', 'Location not found!');
  115 + setText('searchInfo', '');
  116 + return false;
  117 + }
  118 +
  119 + var geohash = encodeGeoHash(gLatLng.lat(), gLatLng.lng());
  120 + document.getElementById("geoHash").value = geohash;
  121 + var resolution = document.getElementById("hashResolution").value;
  122 + geohash = geohash.substr(0,resolution);
  123 + var geoHashBox = new GeoHashBox(geohash);
  124 + geoHashBox.centerMap();
  125 + geoHashBox.showNeighbors();
  126 +
  127 + boxList = document.getElementById("boxList");
  128 + boxList.innerHTML = "LEFT(geohash," + resolution + ") IN (";
  129 + var boxes = [];
  130 + for (var n in geoHashBox.neighbors) {
  131 + boxes.push("'"+geoHashBox.neighbors[n].geohash+"'");
  132 + }
  133 + boxes.push("'"+geoHashBox.geohash+"'");
  134 + boxList.innerHTML += boxes.join(',') + ")";
  135 +
  136 + searchInfo = document.getElementById("searchInfo");
  137 + var xdistance = geoHashBox.neighbors.topleft.corners.topleft.distanceFrom(geoHashBox.neighbors.topright.corners.topright);
  138 + var ydistance = geoHashBox.neighbors.topleft.corners.topleft.distanceFrom(geoHashBox.neighbors.bottomleft.corners.bottomleft);
  139 + var searcharea = parseInt((xdistance/1000) * (ydistance/1000)*100)/100;
  140 + if (xdistance>2000) {
  141 + xdistance = parseInt(xdistance/10)/100;
  142 + ydistance = parseInt(ydistance/10)/100;
  143 + units = "km";
  144 + } else {
  145 + xdistance = parseInt(xdistance+0.5);
  146 + ydistance = parseInt(ydistance+0.5);
  147 + units = "m";
  148 + }
  149 + var lat = parseInt(gLatLng.lat()*1000)/1000;
  150 + var lng = parseInt(gLatLng.lng()*1000)/1000;
  151 + searchInfo.innerHTML = lat + ", " + lng + " [w:" + xdistance + units + ", h:" + ydistance + units + "] (" + searcharea + "km2)";
  152 +
  153 + // var myIcon = new GIcon({image : './anchor.png', shadow : './shadow.png'});
  154 + // var myMarker = new GMarker(gLatLng);
  155 + // map.addOverlay(myMarker);
  156 +}
  157 +
  158 +function setText(s,t) {
  159 + sp = document.getElementById(s);
  160 + sp.innerHTML = t;
  161 +}
  162 +
  163 +function cleanUp() {
  164 + map.clearOverlays();
  165 + setText('boxList','');
  166 + setText('searchInfo','');
  167 +}
  168 +
  169 +window.onload = function () {
  170 + if (GBrowserIsCompatible()) {
  171 + window.onresize = sizeMap;
  172 + sizeMap();
  173 + GEvent.addDomListener(document.getElementById('map'), "DOMMouseScroll", wheelZoom);
  174 + GEvent.addDomListener(document.getElementById('map'), "mousewheel", wheelZoom);
  175 + } else {
  176 + alert("Sorry, your browser is lame!")
  177 + }
  178 +}
... ...
pacotes/geohash-js-master/geohash.js 0 → 100644
... ... @@ -0,0 +1,112 @@
  1 +// geohash.js
  2 +// Geohash library for Javascript
  3 +// (c) 2008 David Troy
  4 +// Distributed under the MIT License
  5 +
  6 +BITS = [16, 8, 4, 2, 1];
  7 +
  8 +BASE32 = "0123456789bcdefghjkmnpqrstuvwxyz";
  9 +NEIGHBORS = { right : { even : "bc01fg45238967deuvhjyznpkmstqrwx" },
  10 + left : { even : "238967debc01fg45kmstqrwxuvhjyznp" },
  11 + top : { even : "p0r21436x8zb9dcf5h7kjnmqesgutwvy" },
  12 + bottom : { even : "14365h7k9dcfesgujnmqp0r2twvyx8zb" } };
  13 +BORDERS = { right : { even : "bcfguvyz" },
  14 + left : { even : "0145hjnp" },
  15 + top : { even : "prxz" },
  16 + bottom : { even : "028b" } };
  17 +
  18 +NEIGHBORS.bottom.odd = NEIGHBORS.left.even;
  19 +NEIGHBORS.top.odd = NEIGHBORS.right.even;
  20 +NEIGHBORS.left.odd = NEIGHBORS.bottom.even;
  21 +NEIGHBORS.right.odd = NEIGHBORS.top.even;
  22 +
  23 +BORDERS.bottom.odd = BORDERS.left.even;
  24 +BORDERS.top.odd = BORDERS.right.even;
  25 +BORDERS.left.odd = BORDERS.bottom.even;
  26 +BORDERS.right.odd = BORDERS.top.even;
  27 +
  28 +function refine_interval(interval, cd, mask) {
  29 + if (cd&mask)
  30 + interval[0] = (interval[0] + interval[1])/2;
  31 + else
  32 + interval[1] = (interval[0] + interval[1])/2;
  33 +}
  34 +
  35 +function calculateAdjacent(srcHash, dir) {
  36 + srcHash = srcHash.toLowerCase();
  37 + var lastChr = srcHash.charAt(srcHash.length-1);
  38 + var type = (srcHash.length % 2) ? 'odd' : 'even';
  39 + var base = srcHash.substring(0,srcHash.length-1);
  40 + if (BORDERS[dir][type].indexOf(lastChr)!=-1)
  41 + base = calculateAdjacent(base, dir);
  42 + return base + BASE32[NEIGHBORS[dir][type].indexOf(lastChr)];
  43 +}
  44 +
  45 +function decodeGeoHash(geohash) {
  46 + var is_even = 1;
  47 + var lat = []; var lon = [];
  48 + lat[0] = -90.0; lat[1] = 90.0;
  49 + lon[0] = -180.0; lon[1] = 180.0;
  50 + lat_err = 90.0; lon_err = 180.0;
  51 +
  52 + for (i=0; i<geohash.length; i++) {
  53 + c = geohash[i];
  54 + cd = BASE32.indexOf(c);
  55 + for (j=0; j<5; j++) {
  56 + mask = BITS[j];
  57 + if (is_even) {
  58 + lon_err /= 2;
  59 + refine_interval(lon, cd, mask);
  60 + } else {
  61 + lat_err /= 2;
  62 + refine_interval(lat, cd, mask);
  63 + }
  64 + is_even = !is_even;
  65 + }
  66 + }
  67 + lat[2] = (lat[0] + lat[1])/2;
  68 + lon[2] = (lon[0] + lon[1])/2;
  69 +
  70 + return { latitude: lat, longitude: lon};
  71 +}
  72 +
  73 +function encodeGeoHash(latitude, longitude) {
  74 + var is_even=1;
  75 + var i=0;
  76 + var lat = []; var lon = [];
  77 + var bit=0;
  78 + var ch=0;
  79 + var precision = 12;
  80 + geohash = "";
  81 +
  82 + lat[0] = -90.0; lat[1] = 90.0;
  83 + lon[0] = -180.0; lon[1] = 180.0;
  84 +
  85 + while (geohash.length < precision) {
  86 + if (is_even) {
  87 + mid = (lon[0] + lon[1]) / 2;
  88 + if (longitude > mid) {
  89 + ch |= BITS[bit];
  90 + lon[0] = mid;
  91 + } else
  92 + lon[1] = mid;
  93 + } else {
  94 + mid = (lat[0] + lat[1]) / 2;
  95 + if (latitude > mid) {
  96 + ch |= BITS[bit];
  97 + lat[0] = mid;
  98 + } else
  99 + lat[1] = mid;
  100 + }
  101 +
  102 + is_even = !is_even;
  103 + if (bit < 4)
  104 + bit++;
  105 + else {
  106 + geohash += BASE32[ch];
  107 + bit = 0;
  108 + ch = 0;
  109 + }
  110 + }
  111 + return geohash;
  112 +}
... ...
pacotes/geohash-js-master/labeledmarker.js 0 → 100644
... ... @@ -0,0 +1,142 @@
  1 +/*
  2 +* LabeledMarker Class
  3 +*
  4 +* Copyright 2007 Mike Purvis (http://uwmike.com)
  5 +*
  6 +* Licensed under the Apache License, Version 2.0 (the "License");
  7 +* you may not use this file except in compliance with the License.
  8 +* You may obtain a copy of the License at
  9 +*
  10 +* http://www.apache.org/licenses/LICENSE-2.0
  11 +*
  12 +* Unless required by applicable law or agreed to in writing, software
  13 +* distributed under the License is distributed on an "AS IS" BASIS,
  14 +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 +* See the License for the specific language governing permissions and
  16 +* limitations under the License.
  17 +*
  18 +* This class extends the Maps API's standard GMarker class with the ability
  19 +* to support markers with textual labels. Please see articles here:
  20 +*
  21 +* http://googlemapsbook.com/2007/01/22/extending-gmarker/
  22 +* http://googlemapsbook.com/2007/03/06/clickable-labeledmarker/
  23 +*/
  24 +
  25 +/**
  26 + * Constructor for LabeledMarker, which picks up on strings from the GMarker
  27 + * options array, and then calls the GMarker constructor.
  28 + *
  29 + * @param {GLatLng} latlng
  30 + * @param {GMarkerOptions} Named optional arguments:
  31 + * opt_opts.labelText {String} text to place in the overlay div.
  32 + * opt_opts.labelClass {String} class to use for the overlay div.
  33 + * (default "LabeledMarker_markerLabel")
  34 + * opt_opts.labelOffset {GSize} label offset, the x- and y-distance between
  35 + * the marker's latlng and the upper-left corner of the text div.
  36 + */
  37 +function LabeledMarker(latlng, opt_opts){
  38 + this.latlng_ = latlng;
  39 + this.opts_ = opt_opts || {};
  40 +
  41 + this.labelText_ = this.opts_.labelText || "";
  42 + this.labelClass_ = this.opts_.labelClass || "LabeledMarker_markerLabel";
  43 + this.labelOffset_ = this.opts_.labelOffset || new GSize(0, 0);
  44 +
  45 + this.clickable_ = this.opts_.clickable || true;
  46 +
  47 + if (this.opts_.draggable) {
  48 + // This version of LabeledMarker doesn't support dragging.
  49 + this.opts_.draggable = false;
  50 + }
  51 +
  52 + GMarker.apply(this, arguments);
  53 +}
  54 +
  55 +
  56 +// It's a limitation of JavaScript inheritance that we can't conveniently
  57 +// inherit from GMarker without having to run its constructor. In order for
  58 +// the constructor to run, it requires some dummy GLatLng.
  59 +LabeledMarker.prototype = new GMarker(new GLatLng(0, 0));
  60 +
  61 +/**
  62 + * Is called by GMap2's addOverlay method. Creates the text div and adds it
  63 + * to the relevant parent div.
  64 + *
  65 + * @param {GMap2} map the map that has had this labeledmarker added to it.
  66 + */
  67 +LabeledMarker.prototype.initialize = function(map) {
  68 + // Do the GMarker constructor first.
  69 + GMarker.prototype.initialize.apply(this, arguments);
  70 +
  71 + this.map_ = map;
  72 + this.div_ = document.createElement("div");
  73 + this.div_.className = this.labelClass_;
  74 + this.div_.innerHTML = this.labelText_;
  75 + this.div_.style.position = "absolute";
  76 + this.div_.style.cursor = "pointer";
  77 + map.getPane(G_MAP_MARKER_PANE).appendChild(this.div_);
  78 +
  79 + if (this.clickable_) {
  80 + /**
  81 + * Creates a closure for passing events through to the source marker
  82 + * This is located in here to avoid cluttering the global namespace.
  83 + * The downside is that the local variables from initialize() continue
  84 + * to occupy space on the stack.
  85 + *
  86 + * @param {Object} object to receive event trigger.
  87 + * @param {GEventListener} event to be triggered.
  88 + */
  89 + function newEventPassthru(obj, event) {
  90 + return function() {
  91 + GEvent.trigger(obj, event);
  92 + };
  93 + }
  94 +
  95 + // Pass through events fired on the text div to the marker.
  96 + var eventPassthrus = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout'];
  97 + for(var i = 0; i < eventPassthrus.length; i++) {
  98 + var name = eventPassthrus[i];
  99 + GEvent.addDomListener(this.div_, name, newEventPassthru(this, name));
  100 + }
  101 + }
  102 +}
  103 +
  104 +/**
  105 + * Move the text div based on current projection and zoom level, call the redraw()
  106 + * handler in GMarker.
  107 + *
  108 + * @param {Boolean} force will be true when pixel coordinates need to be recomputed.
  109 + */
  110 +LabeledMarker.prototype.redraw = function(force) {
  111 + GMarker.prototype.redraw.apply(this, arguments);
  112 +
  113 + // Calculate the DIV coordinates of two opposite corners of our bounds to
  114 + // get the size and position of our rectangle
  115 + var p = this.map_.fromLatLngToDivPixel(this.latlng_);
  116 + var z = GOverlay.getZIndex(this.latlng_.lat());
  117 +
  118 + // Now position our div based on the div coordinates of our bounds
  119 + this.div_.style.left = (p.x + this.labelOffset_.width) + "px";
  120 + this.div_.style.top = (p.y + this.labelOffset_.height) + "px";
  121 + this.div_.style.zIndex = z; // in front of the marker
  122 +}
  123 +
  124 +/**
  125 + * Remove the text div from the map pane, destroy event passthrus, and calls the
  126 + * default remove() handler in GMarker.
  127 + */
  128 + LabeledMarker.prototype.remove = function() {
  129 + GEvent.clearInstanceListeners(this.div_);
  130 + this.div_.parentNode.removeChild(this.div_);
  131 + this.div_ = null;
  132 + GMarker.prototype.remove.apply(this, arguments);
  133 +}
  134 +
  135 +/**
  136 + * Return a copy of this overlay, for the parent Map to duplicate itself in full. This
  137 + * is part of the Overlay interface and is used, for example, to copy everything in the
  138 + * main view into the mini-map.
  139 + */
  140 +LabeledMarker.prototype.copy = function() {
  141 + return new LabeledMarker(this.latlng_, this.opt_opts_);
  142 +}
0 143 \ No newline at end of file
... ...
pacotes/geohash-js-master/matrix.txt 0 → 100644
... ... @@ -0,0 +1,53 @@
  1 +These matrices demonstrate the formation of the geohash base 32
  2 +pattern in both vertical and horizontal orientations.
  3 +
  4 +Even-length geohash strings are arranged in the 'even' pattern,
  5 +while odd-length geohash strings take on the 'odd' pattern.
  6 +This matrix was used to determine the neighbor relationship
  7 +lookup tables.
  8 +
  9 +Even Lengths
  10 +21 23 29 31 21 23 29 31 21 23 29 31
  11 +20 22 28 30 20 22 28 30 20 22 28 30
  12 +17 19 25 27 17 19 25 27 17 19 25 27
  13 +16 18 24 26 16 18 24 26 16 18 24 26
  14 +05 07 13 15 05 07 13 15 05 07 13 15
  15 +04 06 12 14 04 06 12 14 04 06 12 14
  16 +01 03 09 11 01 03 09 11 01 03 09 11
  17 +00 02 08 10 00 02 08 10 00 02 08 10
  18 +
  19 +21 23 29 31 21 23 29 31 21 23 29 31
  20 +20 22 28 30 20 22 28 30 20 22 28 30
  21 +17 19 25 27 17 19 25 27 17 19 25 27
  22 +16 18 24 26 16 18 24 26 16 18 24 26
  23 +05 07 13 15 05 07 13 15 05 07 13 15
  24 +04 06 12 14 04 06 12 14 04 06 12 14
  25 +01 03 09 11 01 03 09 11 01 03 09 11
  26 +00 02 08 10 00 02 08 10 00 02 08 10
  27 +
  28 +21 23 29 31 21 23 29 31 21 23 29 31
  29 +20 22 28 30 20 22 28 30 20 22 28 30
  30 +17 19 25 27 17 19 25 27 17 19 25 27
  31 +16 18 24 26 16 18 24 26 16 18 24 26
  32 +05 07 13 15 05 07 13 15 05 07 13 15
  33 +04 06 12 14 04 06 12 14 04 06 12 14
  34 +01 03 09 11 01 03 09 11 01 03 09 11
  35 +00 02 08 10 00 02 08 10 00 02 08 10
  36 +
  37 +Odd Lengths
  38 +10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31
  39 +08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29
  40 +02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23
  41 +00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21
  42 +
  43 +10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31
  44 +08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29
  45 +02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23
  46 +00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21
  47 +
  48 +10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31
  49 +08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29 08 09 12 13 24 25 28 29
  50 +02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23 02 03 06 07 18 19 22 23
  51 +00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21 00 01 04 05 16 17 20 21
  52 +
  53 +geohash-js code (c) 2008 David Troy; MIT License.
0 54 \ No newline at end of file
... ...