Sebsemillia
Sebsemillia

Reputation: 9476

Google Maps API Javascript KML Hover Effect on Markers

I use the google Maps Javascript API and set my custom markers on it with a kml file (the custom marker image is set via the kml file). Now I want to add a hover effect on the markers (it is the same effect for all markers, a title and a marker image change).

Is there any way I can target the markers via jQuery to add the desired effects? I couldn't identify the markers via firebug..

Thank you very much for your effort!

Here is my JavaScript:

$(document).ready(function(){

                            initialize();
                            var map;
                            function initialize() {
                            var myLatlng = new google.maps.LatLng(52.52427, 13.40629);
                            var myOptions = {
                                zoom: 11,
                                center: myLatlng,
                                mapTypeId: google.maps.MapTypeId.ROADMAP
                            }
                            map = new google.maps.Map(document.getElementById("Map"), myOptions);

                            var kmlLayer = new google.maps.KmlLayer('http://www.example.de/test6/1.kml');
                            kmlLayer.setMap(map);

                        });

Unfortunately I can't paste the kml content here. So I uploaded it here: http://pastebin.com/HUgABVvx

I'm looking forward to your answers. Thank you! :)

Upvotes: 2

Views: 1284

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117314

You cannot apply effects for markers inside a KML-Layer. The markers you see there are not the images you set, they be a part of a tile.

The only way I see is to parse the KML-file and create real markers.

Upvotes: 2

Related Questions