mapbox / tokml

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

Mapbox Marker API no longer exists #43

Open thejasonxie opened 10 months ago

thejasonxie commented 10 months ago

See the line of code here for icon marker: https://github.com/mapbox/tokml/blob/91c3fa5fb256ef74307847e21de53dbb1f043349/index.js#L203

https://api.tiles.mapbox.com/v3/marker/ no longer exists i think. Not sure if mapbox has another API for markers.

thejasonxie commented 10 months ago

If anyone is experiencing this issue, my work around was just to set my geosjon simplestyle to have a white large marker which generates a url with that broken api that I replace with a pin from google map.

kml = kml
      .toString()
      .replace(
        'https://api.tiles.mapbox.com/v3/marker/pin-l+fff.png',
        'http://maps.google.com/mapfiles/kml/paddle/wht-circle.png',
      );

// then use xml-formatter

for other icons, refer to http://kml4earth.appspot.com/icons.html

This works for my use case because I only need this one white marker.