JP wrote:
> I noticed that I am able to get all the markers using EGeoXml via
> gmarkers.
>
> Is there something similar for the GeoXml extension?
>
Say with an instance variable called geoxmlvar.
geoxmlvar.overlayman.markers is an array containing all the elements markers
lines and polys.
The id of each if it has one (normal xml id unique to the element) and
its title are both stored as expansions of the marker element
the name (which i call a title), is not guaranteed to be unique however
an xml id is.
function ClickByName(name){
var marks = geoxmlvar.overlayman.markers;
for(m = 0;m < marks.length;m++){
var val = marks[m].title; //or var val = marks[m].id;
if(name == val){
this.overlayman.markers[m].show();
this.overlayman.markers[m].hidden = false;
GEvent.trigger(geoxmlvar.overlayman.markers[m],"click");
break;
}
}
}
The above is not tested just off the top of my head
> ______________________________________________________________________
>
> I would like to build something like this example below I saw for the
> econym extension
> ______________________________________________________________________
>
> // Store the names
> function mySideBar(ref, name, type, i, html) {
> nameArray[name] = i;
> return "";
> }
>
> // use the name to click the marker
> function clickByName(name) {
> GEvent.trigger(exml.gmarkers[nameArray[name]], "click")
> }
>
> var exml = new EGeoXml("exml", map, "whatever.xml",
> {sidebarid:"the_side_bar",sidebarfn:mySideBar});
> exml.parse();
>
> <a href="javascript:clickByName('My House')">Marker 1</a>
>
>
> -----------------------------------------------------------------------------------------------------------------
> I feel sometimes that EGeoXml is like a claymore sword; powerful and
> its well documented what you can do with it... where the GeoXml is
> like katana sword; finesse and sharp edge with a intriguing mystery
> behind.
>
>
> >
> .
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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
-~----------~----~----~----~------~----~------~--~---
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.43/2139 - Release Date: 05/28/09
08:10:00