mapbox / tokml

Convert GeoJSON to KML.
http://mapbox.github.io/tokml/
BSD 2-Clause "Simplified" License
189 stars 91 forks source link

Broken icon link #38

Closed ramtob closed 6 years ago

ramtob commented 6 years ago

Hello. When converting a point geometry to KML, toKML adds the following style:

<Style id="mcwhitemsmediums27b2cfsw1mo1ffffffffo04">
            <IconStyle>
                <Icon>
                    <href>https://api.tiles.mapbox.com/v3/marker/pin-m+white.png</href>
                </Icon>
            </IconStyle>
            <hotSpot xunits="fraction" yunits="fraction" x="0.5" y="0.5"></hotSpot>
        </Style>

But the icon link https://api.tiles.mapbox.com/v3/marker/pin-m+white.png is broken.

If I try to access the icon link directly, I get the message: {"message":"Invalid marker: pin-m+white(0,0)"}

If I upload the KML file to Google Earth, it shows a faulty (red-X) icon. image

ramtob commented 6 years ago

Turned out we passed marker color as "white", but toKml() does not recognize it like that. It expects e.g. "#ffffff"