placemark / togeojson

convert KML, TCX, and GPX to GeoJSON, without the fuss
https://placemark.github.io/togeojson/
BSD 2-Clause "Simplified" License
401 stars 67 forks source link

Add support for hotspot x and y units #78

Closed kthyer closed 2 years ago

kthyer commented 2 years ago

Solves #74

This adds support for hotspot xunits and yunits.

hotspot x and y values on there own were not enough to properly support the icon-offset style property. The hotspot attribute also specified a unit type for the x and y units which could be one of pixels, insetPixels, or fraction. The unit type greatly effects how to process the x and y values provided by the x and y attribute of the hotspot.

With this PR, now in addition to converted files providing the icon-offset style property, if a hotspot for an icon is specified, it will now also provide the icon-offset-units style property in the same an [x-unit-type, y-unit-type] format.

This is similar to the format of icon-offset which is [x, y].

This will allow users to be able to properly display icons based on their offset values and unit types.

tmcw commented 2 years ago

Thanks! Tweaked and merged in #79