Ignore:
Timestamp:
Dec 8, 2011, 10:36:35 PM (12 years ago)
Author:
rvelices
Message:

rv_gmaps use places autocomplete + added new markers + better algo for displaying markers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/template/data_loader.js

    r12701 r12706  
    7777        var bounds = new google.maps.LatLngBounds( this._map.getBounds().getSouthWest(), this._map.getBounds().getNorthEast() );
    7878       
    79         //bug as of v 3.7 -
     79        //BEGIN BUG in maps api as of v3.7 - when map wraps horizontally more than 360 deg - the getBounds is wrong
    8080        var isOver = false;
    8181        if (bounds.getSouthWest().lng() < bounds.getNorthEast().lng())
     
    9090                isOver = true;
    9191        }
     92        if (!isOver)
     93        {//very emprical tests
     94                if (this._map.getDiv().offsetWidth / this._map.getDiv().offsetHeight > 1.3
     95                                && this._map.getZoom()<3
     96                                && bounds.getSouthWest().lat() < -50
     97                                && bounds.getNorthEast().lat() > 50)
     98                {
     99                        isOver = true;
     100                }
     101        }
    92102       
    93103        if (isOver)
    94104                bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-179.9), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.9) );
    95         //end bug
     105        //END bug
    96106       
    97107       
     
    117127        /*if ( !bounds.isFullLat() )*/
    118128        {
    119                 nd = latRange*12/100;
    120                 sd = latRange*4/100;
     129                nd = latRange*0.12;
     130                sd = latRange*0.04;
    121131        }
    122132        /*if ( !bounds.isFullLng() )*/
    123133        {
    124                 ed = lonRange*9/100;
    125                 wd = lonRange*7/100;
     134                ed = lonRange*0.09;
     135                wd = lonRange*0.07;
    126136        }
    127137        var digits = Math.max( getLatLonDigits(latRange,4,2), getLatLonDigits(lonRange,4,2) );
Note: See TracChangeset for help on using the changeset viewer.