NiffyShibby
NiffyShibby

Reputation: 57

Google Maps label a marker with KML

I was wondering, say I've got a KML file of points at locations. When I upload the KML and direct google maps to the file, it will show the points.
Now is is possible in the KML file to label that point, Just like Google Maps does when I search for airports or plumbers? Example like this: http://localhostr.com/files/boNhHEB/capture.png I want to do the markers with Numbers instead of letters.
Is this possible just using KML? or would I have to script this?

Upvotes: 1

Views: 11075

Answers (2)

Magallo
Magallo

Reputation: 196

The link you reported (http://code.google.com/intl/nl-NL/apis/kml/documentation/kml_tut.html#custom_styles) describes the usage of style to specifiy a placemark at a specific location represented using an image. For example:

<Style id="highlightPlacemark">
    <IconStyle>
        <Icon>
            <href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
        </Icon>
    </IconStyle>
</Style>

here there is specified only the .png image that must be used to represent the placemark. What about the label text? What are the tags do define a text? And how to use it?

Another question: what if I would like to add text in my kml not inside a baloon placemark but freely in a zone without a placemarker with an icon?

Upvotes: 0

Eddy
Eddy

Reputation: 5370

Yes you can using styles and adding a <styleurl> to each placemark

See: http://code.google.com/intl/nl-NL/apis/kml/documentation/kml_tut.html#custom_styles or http://econym.org.uk/gmap/kml.htm

If you want to show a number in each placemark you will however have to create a custom image (and style) for each one.

Upvotes: 1

Related Questions