Only Display Names on MouseOver

4,654 views
Skip to first unread message

Jon H

unread,
Mar 15, 2010, 3:13:31 PM3/15/10
to KML Developer Support - Getting Started with KML
I have an Access Database that goes through a table of lat/longs and
generates very simple KML such as the following. I would like the
placemark name field to only display when the icon has the mouseover
event. It appears that the default must be to always display. Is
there a simple tag that can be added to make this happen. Any
thoughts would be greatly appreciated.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document> <name> Transformer Test 2 </name>
<Folder> <name>Chicago / Chicago North</name>
<Style> <PolyStyle> <color> ff0000ff</color> </PolyStyle></Style>
<Placemark> <name>00622503B</name>
<Snippet maxLines="1">167</Snippet>
<Description>00622503B - 167 kVA - M-120002-120/240</Description>
<Style>
<IconStyle>
<scale>1.2</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/caution.png</href>
</Icon>
</IconStyle>
</Style>
<Point> <coordinates> -87.69262,42.01124,0</coordinates> </Point>
</Placemark>
</Folder>
</Document>
</kml>

Nymor

unread,
Mar 16, 2010, 4:32:58 AM3/16/10
to KML Developer Support - Getting Started with KML
Hi Jon,

Yes it's easy to do - you just have to use StyleMap instead of Style
within the Placemark - see
http://code.google.com/apis/kml/documentation/kmlreference.html#stylemap

... then when defining the 2 Styles within the StyleMap set the label
scale of the Normal Style to 0.

Regards
Nymor

Jon H

unread,
Mar 16, 2010, 8:13:37 PM3/16/10
to KML Developer Support - Getting Started with KML
Thank you so much.

On Mar 16, 3:32 am, Nymor wrote:
> Hi Jon,
>
> Yes it's easy to do - you just have to use StyleMap instead of Style

> within the Placemark - seehttp://code.google.com/apis/kml/documentation/kmlreference.html#stylemap

> > </kml>- Hide quoted text -
>
> - Show quoted text -

Sharif Uddin

unread,
Dec 2, 2014, 10:11:35 AM12/2/14
to kml-support-g...@googlegroups.com
can you show an example of this on goggle maps using a kml to display hover over text.

barryhunter (KML Guru)

unread,
Dec 2, 2014, 12:29:27 PM12/2/14
to kml-support-g...@googlegroups.com
Google Maps does not support styleMap


... to get the same result, it could be explicitly coded with the Google Maps API based map, but will need coding in Javascript not purely KML. 

Maybe using Labeled marker
along with mouseover/mouseout events on the marker. 

Reply all
Reply to author
Forward
0 new messages