Loading ...
Sorry, an error occurred while loading the content.

Map Zoom Problem

Expand Messages
  • ccrcoder
    I am trying to get a map that is loaded with georss to zoom to a specific level. I am doing it on pageload. No matter what I do, I cannot get the map to zoom
    Message 1 of 2 , Jan 28, 2008
    View Source
    • 0 Attachment
      I am trying to get a map that is loaded with georss to zoom to a
      specific level. I am doing it on pageload. No matter what I do, I
      cannot get the map to zoom to a specific level. Am I calling methods
      in the wrong order? why is it that I can't get the map to zoom to a
      specified level? The function I am using is below..

      function getMap(el,cat)
      {
      var w = 450;
      var h = 292;
      var z = 12;
      var sz = new YSize(w,h);
      var geo = new YGeoRSS('http://www.myserver.com/rsspath/geo.rss');
      var map = new YMap(el,null,sz);
      map.setZoomLevel(5)
      map.addZoomLong();
      map.addZoomShort();
      map.addTypeControl();
      map.addOverlay(geo);
      return map;
      }
    • d_wengert
      I had the same problem. I think what happens is once you create a new YGeoRSS, that class does a bunch of stuff behind the scenes and ignores your zoom level.
      Message 2 of 2 , Feb 5, 2008
      View Source
      • 0 Attachment
        I had the same problem. I think what happens is once you create a new
        YGeoRSS, that class does a bunch of stuff behind the scenes and
        ignores your zoom level. You can fix it with a function and a
        listener, like so:

        var GeoRSSdone = function(e) {
        map.drawZoomAndCenter("75214", 4);
        };

        YEvent.Capture(map,EventsList.onEndGeoRSS, GeoRSSdone);


        --- In yws-maps@yahoogroups.com, "ccrcoder" <hammer65@...> wrote:
        >
        > I am trying to get a map that is loaded with georss to zoom to a
        > specific level. I am doing it on pageload. No matter what I do, I
        > cannot get the map to zoom to a specific level. Am I calling methods
        > in the wrong order? why is it that I can't get the map to zoom to a
        > specified level? The function I am using is below..
        >
        > function getMap(el,cat)
        > {
        > var w = 450;
        > var h = 292;
        > var z = 12;
        > var sz = new YSize(w,h);
        > var geo = new YGeoRSS('http://www.myserver.com/rsspath/geo.rss');
        > var map = new YMap(el,null,sz);
        > map.setZoomLevel(5)
        > map.addZoomLong();
        > map.addZoomShort();
        > map.addTypeControl();
        > map.addOverlay(geo);
        > return map;
        > }
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.