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

User clicks on map, gets lat/lon

Expand Messages
  • jnj.puma2000
    I was looking through the API and couldn t find any simple way to get the latitude and longitude of a click location from the map. This would allow the user
    Message 1 of 8 , Nov 26, 2006
    View Source
    • 0 Attachment
      I was looking through the API and couldn't find any simple way to get
      the latitude and longitude of a click location from the map. This
      would allow the user to interact with the map more richly.

      I suppose you could write your own custom tool for this, but it seems
      like this is something that should exist within the API already.
      Perhaps I am just not seeing it.

      Any thoughts on how I could do this?
    • Randy Troppmann
      Yes, there is an onClick event for the map that returns lat/lon. It is in the api listed here: http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
      Message 2 of 8 , Nov 26, 2006
      View Source
      • 0 Attachment
        Yes, there is an onClick event for the map that returns lat/lon. It is
        in the api listed here:

        http://developer.yahoo.com/maps/flash/V3.04/flashReference.html


        Randy

        On 11/26/06, jnj.puma2000 <djpug@...> wrote:
        >
        >
        >
        >
        >
        >
        > I was looking through the API and couldn't find any simple way to get
        > the latitude and longitude of a click location from the map. This
        > would allow the user to interact with the map more richly.
        >
        > I suppose you could write your own custom tool for this, but it seems
        > like this is something that should exist within the API already.
        > Perhaps I am just not seeing it.
        >
        > Any thoughts on how I could do this?
        >
        >
      • jnj.puma2000
        I see it now. I was referencing an earlier version of the API. http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map I guess that was v3.0? Do I
        Message 3 of 8 , Nov 26, 2006
        View Source
        • 0 Attachment
          I see it now. I was referencing an earlier version of the API.
          http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map

          I guess that was v3.0? Do I have to do something different to get
          3.04, like register a different component or something?

          Thanks.

          --- In yws-maps@yahoogroups.com, "Randy Troppmann"
          <randy.troppmann@...> wrote:
          >
          > Yes, there is an onClick event for the map that returns lat/lon. It is
          > in the api listed here:
          >
          > http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
          >
          >
          > Randy
          >
          > On 11/26/06, jnj.puma2000 <djpug@...> wrote:
          > >
          > >
          > >
          > >
          > >
          > >
          > > I was looking through the API and couldn't find any simple way to get
          > > the latitude and longitude of a click location from the map. This
          > > would allow the user to interact with the map more richly.
          > >
          > > I suppose you could write your own custom tool for this, but it seems
          > > like this is something that should exist within the API already.
          > > Perhaps I am just not seeing it.
          > >
          > > Any thoughts on how I could do this?
          > >
          > >
          >
        • Zach Graves
          Hi, Which Flash API are you using? If you are using the JS api you just need to update the script url. AS and Flex you need to download the new component swc
          Message 4 of 8 , Nov 26, 2006
          View Source
          • 0 Attachment
            Hi,

            Which Flash API are you using? If you are using the JS api you just
            need to update the script url. AS and Flex you need to download the
            new component swc and update it in your app.

            Also note that the onclick event is dispatched from PanTool, so you
            need that tool added to the map.

            -z

            --- In yws-maps@yahoogroups.com, "jnj.puma2000" <djpug@...> wrote:
            >
            >
            > I see it now. I was referencing an earlier version of the API.
            > http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map
            >
            > I guess that was v3.0? Do I have to do something different to get
            > 3.04, like register a different component or something?
            >
            > Thanks.
            >
            > --- In yws-maps@yahoogroups.com, "Randy Troppmann"
            > <randy.troppmann@> wrote:
            > >
            > > Yes, there is an onClick event for the map that returns lat/lon. It is
            > > in the api listed here:
            > >
            > > http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
            > >
            > >
            > > Randy
            > >
            > > On 11/26/06, jnj.puma2000 <djpug@> wrote:
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > > I was looking through the API and couldn't find any simple way
            to get
            > > > the latitude and longitude of a click location from the map. This
            > > > would allow the user to interact with the map more richly.
            > > >
            > > > I suppose you could write your own custom tool for this, but it
            seems
            > > > like this is something that should exist within the API already.
            > > > Perhaps I am just not seeing it.
            > > >
            > > > Any thoughts on how I could do this?
            > > >
            > > >
            > >
            >
          • whispers007spy
            Hi.. can some post a simple example? Im still unsure as to how to go abotu this.. ok..so you use the onClick event, add a listener for it.. then what? you
            Message 5 of 8 , Nov 26, 2006
            View Source
            • 0 Attachment
              Hi.. can some post a simple example?

              Im still unsure as to how to go abotu this..
              ok..so you use the onClick event, add a listener for it.. then what?

              you write function that will convert that click to a lat/lon object?





              --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@...> wrote:
              >
              > Hi,
              >
              > Which Flash API are you using? If you are using the JS api you just
              > need to update the script url. AS and Flex you need to download the
              > new component swc and update it in your app.
              >
              > Also note that the onclick event is dispatched from PanTool, so you
              > need that tool added to the map.
              >
              > -z
              >
              > --- In yws-maps@yahoogroups.com, "jnj.puma2000" <djpug@> wrote:
              > >
              > >
              > > I see it now. I was referencing an earlier version of the API.
              > > http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map
              > >
              > > I guess that was v3.0? Do I have to do something different to get
              > > 3.04, like register a different component or something?
              > >
              > > Thanks.
              > >
              > > --- In yws-maps@yahoogroups.com, "Randy Troppmann"
              > > <randy.troppmann@> wrote:
              > > >
              > > > Yes, there is an onClick event for the map that returns lat/lon.
              It is
              > > > in the api listed here:
              > > >
              > > > http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
              > > >
              > > >
              > > > Randy
              > > >
              > > > On 11/26/06, jnj.puma2000 <djpug@> wrote:
              > > > >
              > > > >
              > > > >
              > > > >
              > > > >
              > > > >
              > > > > I was looking through the API and couldn't find any simple way
              > to get
              > > > > the latitude and longitude of a click location from the map. This
              > > > > would allow the user to interact with the map more richly.
              > > > >
              > > > > I suppose you could write your own custom tool for this, but it
              > seems
              > > > > like this is something that should exist within the API already.
              > > > > Perhaps I am just not seeing it.
              > > > >
              > > > > Any thoughts on how I could do this?
              > > > >
              > > > >
              > > >
              > >
              >
            • Zach Graves
              import com.yahoo.maps.LatLon; import com.yahoo.maps.tools.PanTool; import com.yahoo.maps.markers.CustomPOIMarker; myMap.addEventListener( initialize , onInit);
              Message 6 of 8 , Nov 26, 2006
              View Source
              • 0 Attachment
                import com.yahoo.maps.LatLon;
                import com.yahoo.maps.tools.PanTool;
                import com.yahoo.maps.markers.CustomPOIMarker;
                myMap.addEventListener("initialize", onInit);
                var clickLocation:LatLon;
                function onInit(e:Object):Void {
                myMap.addTool(new PanTool(), true);
                myMap.addEventListener("onClick", onMapClick);
                }
                function onMapClick(e:Object):Void {
                clickLocation = e.latlon;
                trace(clickLocation);
                var myMarker = {index:"YMarker", title:"", description:clickLocation,
                markerColor:0x990099, strokeColor:0xFFFF00};
                myMap.addMarkerByLatLon(CustomPOIMarker, clickLocation, myMarker);
                }


                --- In yws-maps@yahoogroups.com, "whispers007spy" <whispers007@...> wrote:
                >
                > Hi.. can some post a simple example?
                >
                > Im still unsure as to how to go abotu this..
                > ok..so you use the onClick event, add a listener for it.. then what?
                >
                > you write function that will convert that click to a lat/lon object?
                >
                >
                >
                >
                >
                > --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@> wrote:
                > >
                > > Hi,
                > >
                > > Which Flash API are you using? If you are using the JS api you just
                > > need to update the script url. AS and Flex you need to download the
                > > new component swc and update it in your app.
                > >
                > > Also note that the onclick event is dispatched from PanTool, so you
                > > need that tool added to the map.
                > >
                > > -z
                > >
                > > --- In yws-maps@yahoogroups.com, "jnj.puma2000" <djpug@> wrote:
                > > >
                > > >
                > > > I see it now. I was referencing an earlier version of the API.
                > > > http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map
                > > >
                > > > I guess that was v3.0? Do I have to do something different to get
                > > > 3.04, like register a different component or something?
                > > >
                > > > Thanks.
                > > >
                > > > --- In yws-maps@yahoogroups.com, "Randy Troppmann"
                > > > <randy.troppmann@> wrote:
                > > > >
                > > > > Yes, there is an onClick event for the map that returns lat/lon.
                > It is
                > > > > in the api listed here:
                > > > >
                > > > > http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
                > > > >
                > > > >
                > > > > Randy
                > > > >
                > > > > On 11/26/06, jnj.puma2000 <djpug@> wrote:
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > > I was looking through the API and couldn't find any simple way
                > > to get
                > > > > > the latitude and longitude of a click location from the
                map. This
                > > > > > would allow the user to interact with the map more richly.
                > > > > >
                > > > > > I suppose you could write your own custom tool for this, but it
                > > seems
                > > > > > like this is something that should exist within the API
                already.
                > > > > > Perhaps I am just not seeing it.
                > > > > >
                > > > > > Any thoughts on how I could do this?
                > > > > >
                > > > > >
                > > > >
                > > >
                > >
                >
              • VillaMark
                How can i know the Component version, i look into the extension manager and the version I have installed is 3.4.0 i m assuming is the same as 3.04. or if is
                Message 7 of 8 , Nov 27, 2006
                View Source
                • 0 Attachment
                  How can i know the Component version, i look into the extension
                  manager and the version I have installed is 3.4.0 i'm assuming is the
                  same as 3.04. or if is not where can i get the update, because this
                  one i get it from the yahoo page
                  http://developer.yahoo.com/maps/flash/componentEULA.html

                  I tried the code but the onMapClick function did't triggers.
                  any one has this issue?.

                  villamark




                  --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@...> wrote:
                  >
                  > import com.yahoo.maps.LatLon;
                  > import com.yahoo.maps.tools.PanTool;
                  > import com.yahoo.maps.markers.CustomPOIMarker;
                  > myMap.addEventListener("initialize", onInit);
                  > var clickLocation:LatLon;
                  > function onInit(e:Object):Void {
                  > myMap.addTool(new PanTool(), true);
                  > myMap.addEventListener("onClick", onMapClick);
                  > }
                  > function onMapClick(e:Object):Void {
                  > clickLocation = e.latlon;
                  > trace(clickLocation);
                  > var myMarker = {index:"YMarker", title:"", description:clickLocation,
                  > markerColor:0x990099, strokeColor:0xFFFF00};
                  > myMap.addMarkerByLatLon(CustomPOIMarker, clickLocation, myMarker);
                  > }
                  >
                  >
                  > --- In yws-maps@yahoogroups.com, "whispers007spy" <whispers007@> wrote:
                  > >
                  > > Hi.. can some post a simple example?
                  > >
                  > > Im still unsure as to how to go abotu this..
                  > > ok..so you use the onClick event, add a listener for it.. then what?
                  > >
                  > > you write function that will convert that click to a lat/lon object?
                  > >
                  > >
                  > >
                  > >
                  > >
                  > > --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@> wrote:
                  > > >
                  > > > Hi,
                  > > >
                  > > > Which Flash API are you using? If you are using the JS api you just
                  > > > need to update the script url. AS and Flex you need to download the
                  > > > new component swc and update it in your app.
                  > > >
                  > > > Also note that the onclick event is dispatched from PanTool, so you
                  > > > need that tool added to the map.
                  > > >
                  > > > -z
                  > > >
                  > > > --- In yws-maps@yahoogroups.com, "jnj.puma2000" <djpug@> wrote:
                  > > > >
                  > > > >
                  > > > > I see it now. I was referencing an earlier version of the API.
                  > > > > http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map
                  > > > >
                  > > > > I guess that was v3.0? Do I have to do something different to get
                  > > > > 3.04, like register a different component or something?
                  > > > >
                  > > > > Thanks.
                  > > > >
                  > > > > --- In yws-maps@yahoogroups.com, "Randy Troppmann"
                  > > > > <randy.troppmann@> wrote:
                  > > > > >
                  > > > > > Yes, there is an onClick event for the map that returns lat/lon.
                  > > It is
                  > > > > > in the api listed here:
                  > > > > >
                  > > > > > http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
                  > > > > >
                  > > > > >
                  > > > > > Randy
                  > > > > >
                  > > > > > On 11/26/06, jnj.puma2000 <djpug@> wrote:
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > I was looking through the API and couldn't find any simple way
                  > > > to get
                  > > > > > > the latitude and longitude of a click location from the
                  > map. This
                  > > > > > > would allow the user to interact with the map more richly.
                  > > > > > >
                  > > > > > > I suppose you could write your own custom tool for this,
                  but it
                  > > > seems
                  > > > > > > like this is something that should exist within the API
                  > already.
                  > > > > > > Perhaps I am just not seeing it.
                  > > > > > >
                  > > > > > > Any thoughts on how I could do this?
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > >
                  > > >
                  > >
                  >
                • jsale37
                  VillaMark, I might have had the same problem until I realized that I need to name my map instance myMap to get this to work. I hope this is all it is for
                  Message 8 of 8 , Dec 5, 2006
                  View Source
                  • 0 Attachment
                    VillaMark,

                    I might have had the same problem until I realized that I need to name
                    my map instance "myMap" to get this to work. I hope this is all it is
                    for you.

                    Jeff


                    --- In yws-maps@yahoogroups.com, "VillaMark" <villamark@...> wrote:
                    >
                    > How can i know the Component version, i look into the extension
                    > manager and the version I have installed is 3.4.0 i'm assuming is the
                    > same as 3.04. or if is not where can i get the update, because this
                    > one i get it from the yahoo page
                    > http://developer.yahoo.com/maps/flash/componentEULA.html
                    >
                    > I tried the code but the onMapClick function did't triggers.
                    > any one has this issue?.
                    >
                    > villamark
                    >
                    >
                    >
                    >
                    > --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@> wrote:
                    > >
                    > > import com.yahoo.maps.LatLon;
                    > > import com.yahoo.maps.tools.PanTool;
                    > > import com.yahoo.maps.markers.CustomPOIMarker;
                    > > myMap.addEventListener("initialize", onInit);
                    > > var clickLocation:LatLon;
                    > > function onInit(e:Object):Void {
                    > > myMap.addTool(new PanTool(), true);
                    > > myMap.addEventListener("onClick", onMapClick);
                    > > }
                    > > function onMapClick(e:Object):Void {
                    > > clickLocation = e.latlon;
                    > > trace(clickLocation);
                    > > var myMarker = {index:"YMarker", title:"", description:clickLocation,
                    > > markerColor:0x990099, strokeColor:0xFFFF00};
                    > > myMap.addMarkerByLatLon(CustomPOIMarker, clickLocation, myMarker);
                    > > }
                    > >
                    > >
                    > > --- In yws-maps@yahoogroups.com, "whispers007spy" <whispers007@>
                    wrote:
                    > > >
                    > > > Hi.. can some post a simple example?
                    > > >
                    > > > Im still unsure as to how to go abotu this..
                    > > > ok..so you use the onClick event, add a listener for it.. then
                    what?
                    > > >
                    > > > you write function that will convert that click to a lat/lon object?
                    > > >
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > --- In yws-maps@yahoogroups.com, "Zach Graves" <z.graves@> wrote:
                    > > > >
                    > > > > Hi,
                    > > > >
                    > > > > Which Flash API are you using? If you are using the JS api you
                    just
                    > > > > need to update the script url. AS and Flex you need to
                    download the
                    > > > > new component swc and update it in your app.
                    > > > >
                    > > > > Also note that the onclick event is dispatched from PanTool,
                    so you
                    > > > > need that tool added to the map.
                    > > > >
                    > > > > -z
                    > > > >
                    > > > > --- In yws-maps@yahoogroups.com, "jnj.puma2000" <djpug@> wrote:
                    > > > > >
                    > > > > >
                    > > > > > I see it now. I was referencing an earlier version of the API.
                    > > > > > http://developer.yahoo.com/maps/flash/V3/flashReference.html#Map
                    > > > > >
                    > > > > > I guess that was v3.0? Do I have to do something different
                    to get
                    > > > > > 3.04, like register a different component or something?
                    > > > > >
                    > > > > > Thanks.
                    > > > > >
                    > > > > > --- In yws-maps@yahoogroups.com, "Randy Troppmann"
                    > > > > > <randy.troppmann@> wrote:
                    > > > > > >
                    > > > > > > Yes, there is an onClick event for the map that returns
                    lat/lon.
                    > > > It is
                    > > > > > > in the api listed here:
                    > > > > > >
                    > > > > > >
                    http://developer.yahoo.com/maps/flash/V3.04/flashReference.html
                    > > > > > >
                    > > > > > >
                    > > > > > > Randy
                    > > > > > >
                    > > > > > > On 11/26/06, jnj.puma2000 <djpug@> wrote:
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > I was looking through the API and couldn't find any
                    simple way
                    > > > > to get
                    > > > > > > > the latitude and longitude of a click location from the
                    > > map. This
                    > > > > > > > would allow the user to interact with the map more richly.
                    > > > > > > >
                    > > > > > > > I suppose you could write your own custom tool for this,
                    > but it
                    > > > > seems
                    > > > > > > > like this is something that should exist within the API
                    > > already.
                    > > > > > > > Perhaps I am just not seeing it.
                    > > > > > > >
                    > > > > > > > Any thoughts on how I could do this?
                    > > > > > > >
                    > > > > > > >
                    > > > > > >
                    > > > > >
                    > > > >
                    > > >
                    > >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.