I don't know if this currently work sor not, but try

onMousedown="javascript:myfunction();"

On Jun 29, 9:18 am, Kivak <[email protected]> wrote:
> Hello everyone!!
>
> I have a, hopefully quick, question about the use of KML files and
> editing objects in Javascript. I am still pretty new to the API and
> the techniques, so I hope this isn't too elementary of a question.
> Basically what I doing for the map construction is that I am taking in
> a KML file with polygons/lines/placemarks and plotting (for lack of
> correct terminology) them onto the map. I am using the <description>
> tag within the <placemark> tag of each of them to display details
> about the location using "CDATA".
>
> What I am trying to do is to put javascript code into the infowindow
> of a placemark. For instance, I want people to be able to click on an
> image in the bubble and it will then show a new image. Now I know that
> google says this is possible with the v3 API. So my first thought was,
> "great! I'll just put an onMousedown="myfunction();" in one of the
> <img> tags and it should work great!" WRONG! Apparently, sometime
> during the page load, the <img> tag's "onMouseDown" turns into a
> "target=blank". So I thought that maybe I could give the image an ID,
> and then use Javascript to be trigger on the infoWindow event. NOPE!
> It completely removes the ID attribute too!
>
> So now I am very frustrated with this KML. The last thing I can think
> of would be to "find" the polygon object from the KML using Javascript
> when the map initializes, then change the description text from there
> to include javascript. I have seen that adding Javascript to the
> polygon or other feature using Javascript itself during the init phase
> works, but I haven't seen anyone actually "find" the feature from the
> KML file and put it into a Javascript object variable.
>
> I hope this makes sense... does anyone have any ideas on how to get
> this to work? And no, it is mandatory that I use KML files rather than
> adding the objects in via Javascript.
>
> Thanks a ton for your time and effort in helping me!!!
> -Kivak

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to