Lance Dyas wrote:
> [EMAIL PROTECTED] wrote:
>   
>> On Oct 3, 9:15 am, searchGod <[EMAIL PROTECTED]> wrote:
>>   
>>     
>>> well i figure while you wait for your reply, i might ask my own
>>> question because i want to do almost the same as you, but got stuck
>>> even earlier. so you might be able to help me out.
>>>
>>> i am trying to just get the openInfoWindowHTML to work with the
>>> multiple created markers. i have followed tutorials and even the same
>>> as your source and yet i get a javascript error when i click on the
>>> marker. here is the map:
>>>
>>> http://www.dodojuice.com/dads/DARs.html
>>>
>>> in the info window i want to be able to pull in various stuff like
>>> logo and website maybe tel and so on... but i cant get the window at
>>> all..
>>>
>>>     
>>>       
>> Your "country marker" icons don't have the infoWindowAnchor defined,
>> so you will get an error if you call any of the
>> marker.openInfoWindowXXXX methods on them.  Either:
>> 1. define the property
>> or
>> 2. use one of the map.openInfoWindowXXXX methods
>>
>>   -- Larry
>>     
>  To do the next step and get a drop down selection ... I recommend using 
> dom methods 
> but you might use the setting inner html method like in Mike Williams 
> example
> the effect should be the same..
>  
> In the example Mike gives he calls the click event on the marker itself 
> which if
> that markers is well gone because of the MarkerManager..well
> when someone tries the drop down you will be calling an event on a 
> nonexistant
> object. so launching its click method can be problematic.
>
> The following is untested code but could give you the idea of what you 
> are after and where
> you might put things.
>
> Inside of  your  setupCountryMarkers
>
> at the begining
>
> var sel = document.createElement("select")
> sel.onchange = function(){
>       var thismarker = allmarkers[this.options[this.selectedIndex].value];
>       map.openInfoWindowHTML(thismarker.getPoint(),thismarker.html,null)
>       }
>
> // Note the above is opening the window on the map not calling the click  
> event
> // of the marker the 
>
> //during your loop...indexed by j?
> //do something like this
>
> var opt = document.createElement("option");
> option.text = title;
> option.value = allmarkers.length
> sel.appendChild(opt);
>
>
> ///then after the loop is done say right before 
> //you add your markers to the the manager
> ///... do something like this... 
>
> document.getElementById('id_of_div_on_the_page_I_want_this_select_in').append(sel);
>
> *
> Inside of CreateMarker*
>
> have createMarker also give the marker a reference to its own html so the 
> onchange event of the selection will work
>
> ie  marker.html = html.. 
>
> hmmm though you will have to make that
>
> var html;
> if (web==null) { 
>       html = fill in your code here???;
>       }
> else {
>       html = fill in your code here???;
>       }
> marker.html = html;
>
>
>   
It occurred to me after posting this that you might want to go the 
opposite direction
in other words drop using MarkerManager so that you can trigger the events
directly on the markers like in Mikes Tutorial. If  you have few enough 
markers that they work in
a drop down menu ... they wont need managed. It makes it somewhat 
simpler and should be practical.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to