call a maker event from a list of markers
I have a series of markers on my map. I also have a list of the names of the locations. The markers are loaded from a XML file, an the list knows the location of each marker. When I click on the name of the marker in the list I panTo(loc) of that marker. What I need to do is have other functionality, like show tooltip, and change size of marker etc. Basically I am trying to figure out how to target a marker either by name or by location from a function that is not the markerEvent of the marker.
Any help would very much appreciated.
Any help would very much appreciated.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?I'm not sure I understand the problem - can you post an example somewhere, preferably some code?
How about using a Dictionary to connect the names to the marker DisplayObject (MovieClip or Sprite or whatever)?
Or in your marker class, listen for MouseEvent.CLICK? -
Inappropriate?Thanks RandomEtc. The code is long and cumbersome, and I am learning as I go so I am not sure which parts are relevant to post and which parts will just confuse you further. I have a "work in progress" version of my project here:
bartjunk.org
I have an XML file that loads a series of stations like this:
<station>
<title>Rockridge</title>
<story>Smells bad, has nasty stuff all over the place.</story>
<loc>37.844275,-122.252898</loc>
<rating>20</rating>
</station>
I have modified the SampleMarker.as contained in ModestMaps v1.0 to have a second property _id this is set to the value of station id attribute in the XML file for ease of use. This value is also used to set the name of the marker.
These are used to place the markers.
SampleMarker.title = Rockridge;
sampleMarker.id = b5;
this is the function that pans the map it is called when a button is clicked. the btn is names "b5", and this name is used to look up the loc in the xml by using the corresponding id attribute:
private function panMapTo(loc:Location){
map.panTo(loc);
};
What I need to do is target the marker and increase its width, and set the contents of its tooltip, but I am not sure how to find it. In all the function in modestMapsSample.as they are targeted based on the event.target. But I need to target the marker based on a known name and other information related to the XML data.
Does this clarify my question?
I’m unsure
-
Inappropriate?Random, Did posted clarification make it worse, or do you now understand what I am trying to do. Please point me in the write direction if you can.
Thanks!
I’m frustrated
Loading Profile...



EMPLOYEE