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

RE: [yws-maps] [AS-Flash] How to move map to new address?

Expand Messages
  • Aaron King
    Hi Craig, Sorry for the delayed reply. I hope this info is still useful to you: The tricky part with this is that when you set the center by address it has
    Message 1 of 2 , Jun 2, 2006
    View Source
    • 0 Attachment
      Hi Craig,



      Sorry for the delayed reply. I hope this info is still useful to you: The
      tricky part with this is that when you set the center by address it has to
      wait for the geocode to be returned from the server. You're best bet to get
      this working is to call setCenterByAddress() and wait for the
      EVENT_MAP_GEOCODE_SUCCESS event to fire, and then call setZoomLevel().
      Alternatively, you could use the geocoding api directly and then make a call
      to setCenterByLatLon and zoom. We've got a feature request open right now
      for a setCenterByAddressAndZoom() function, but I can't make any promises as
      to when that will be released.



      Good Luck!



      Aaron King

      aaronk@...

      _____

      From: yws-maps@yahoogroups.com [mailto:yws-maps@yahoogroups.com] On Behalf
      Of Craig
      Sent: Thursday, May 18, 2006 10:51 AM
      To: yws-maps@yahoogroups.com
      Subject: [yws-maps] [AS-Flash] How to move map to new address?



      I am trying to allow users to input an address and click a button and
      have the map move and zoom into that address. However I am not sure
      how to do it correctly. Here is my actionScript code.

      import com.yahoo.maps.tools.PanTool;
      import com.yahoo.maps.markers.CustomPOIMarker;
      import com.yahoo.maps.widgets.NavigatorWidget;
      import com.yahoo.maps.widgets.SatelliteControlWidget;
      myMap.addEventListener(com.yahoo.maps.api.flash.YahooMap.EVENT_INITIALIZE,
      onInitMap);
      function onInitMap(eventData) {
      var navWidget = new NavigatorWidget("closed");
      myMap.addWidget(navWidget);
      var panTool = new PanTool();
      myMap.addTool(panTool, true);
      var address = " 2880 Broadway, New York, NY 10025";
      myMap.setZoomLevel("17");
      myMap.setCenterByAddress(address, 9);
      var myMarker = {index:'C & J', title:'House', description:'June.',
      markerColor:0xCCCCCC, strokeColor:0xFFFFCC};
      myMap.addMarkerByAddress(CustomPOIMarker, address, myMarker);
      }
      _parent.searchBar.myButton.onRelease = function() {
      var address = _parent.searchBar.address_txt;
      trace(address);
      myMap.setCenterByAddress(address, 9);
      myMap.setZoomLevel("1");
      };


      Is there anyone who can help?

      Thanks.










      SPONSORED LINKS


      Developer
      <http://groups.yahoo.com/gads?t=ms&k=Developer+network&w1=Developer+network&
      w2=Building+blocks&w3=Computer+security&w4=Computer+training&w5=Map&c=5&s=99
      &.sig=afCKAYaS9pHsT1zN3R2t7A> network

      Building
      <http://groups.yahoo.com/gads?t=ms&k=Building+blocks&w1=Developer+network&w2
      =Building+blocks&w3=Computer+security&w4=Computer+training&w5=Map&c=5&s=99&.
      sig=uWbxse_i__kv4F2CkygKOg> blocks

      Computer
      <http://groups.yahoo.com/gads?t=ms&k=Computer+security&w1=Developer+network&
      w2=Building+blocks&w3=Computer+security&w4=Computer+training&w5=Map&c=5&s=99
      &.sig=6pI34rYYJWpkCKQWsMFdIA> security


      Computer
      <http://groups.yahoo.com/gads?t=ms&k=Computer+training&w1=Developer+network&
      w2=Building+blocks&w3=Computer+security&w4=Computer+training&w5=Map&c=5&s=99
      &.sig=vnjvLGD-nw_sMNVkOwtArA> training

      Map
      <http://groups.yahoo.com/gads?t=ms&k=Map&w1=Developer+network&w2=Building+bl
      ocks&w3=Computer+security&w4=Computer+training&w5=Map&c=5&s=99&.sig=1BqSnnyJ
      t-h2JwJKfLPSzw>





      _____

      YAHOO! GROUPS LINKS



      * Visit your group "yws-maps <http://groups.yahoo.com/group/yws-maps>
      " on the web.

      * To unsubscribe from this group, send an email to:
      yws-maps-unsubscribe@yahoogroups.com
      <mailto:yws-maps-unsubscribe@yahoogroups.com?subject=Unsubscribe>

      * Your use of Yahoo! Groups is subject to the Yahoo!
      <http://docs.yahoo.com/info/terms/> Terms of Service.



      _____



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.