Hi,

I need to create Move and Zoom events on map. When the user moves the
map and then stops, it should use the center of the current view and
show all properties within 100 miles radius as visible within the
viewable map area and When user zoom-in or zoom-out it should update
the map to show all properties within 100 miles radius as visible
within the viewable map area
it is similar to zoom and move behavior in zillow.com, e.g:
http://www.zillow.com/homes/irvine,-ca_rb/#/homes/for_sale/Woodbury-Irvine-CA/403197_rid/33.697821,-117.739086,33.689358,-117.759085_rect/15_zm/1_fr/

In my code, I used movend and tilesloaded event listeners but its not
working fine and reload the scirpt multiple times.

See below the  sample of my code:-

  function loadMap() {
      if (GBrowserIsCompatible()) {

    map.addControl(new GLargeMapControl());
      //map.addControl(new GMapTypeControl());
    map.addControl(new GScaleControl());

    map.addControl(new MyLegend());

    map.addControl(new YellowSearchMsg());


      map.enableContinuousZoom();

    geocoder = new GClientGeocoder();



        GEvent.addListener(map,"move", function()
         {
                  var zoomLevel=map.getZoom();
              zoomLevel=parseInt(zoomLevel);
                  if(zoomLevel==7)
                  document.getElementById('yellow-box-msg').style.display='';
                  maploaded=false;

         });



           GEvent.addListener(map,"zoomend",function()
                {
                zoomChanged=true;
                });

         GEvent.addListener(map, "tilesloaded", removeStaticMap);


         GEvent.addListener(map,"moveend", function()
         {

         alert('moveend');
          var zoomLevel=map.getZoom();
          zoomLevel=parseInt(zoomLevel);

                                if((zoomLevel==7) && (map.getCenter().lng()<0)) 
// equal to 50
miles and not out of search area
                                        {
                                          document.getElementById('yellow-big-
area').style.display='none';
                                                if(     maploaded==true)
                                                {
                                                          var point = new
GLatLng(map.getCenter().lat(),map.getCenter().lng());
                                                                
map.clearOverlays();
                                                                
latLongMapView(map.getCenter().lat(),map.getCenter().lng(),
100);
                                                }

                                        }

                             if(zoomChanged==true)
                                 {
                                         zoomChanged=false;

                                         // zoom level msg start here


                                                if(zoomLevel<7) // more than 50 
miles
                                                {
                                                   
document.getElementById('yellow-big-area').style.display='';
                                                }

                             }

                        });
      }
    }

Please suggest me....

Thank you,
Jets

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to