We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be great if we could provide an offset for the custom markers. Something like:
client.getStaticImage({ ... overlays: { coordinates: [18, -33], url: "../../customPin.png", offset: [0.5, 1] }
This would help when we use a custom pin or flag or something where the bottom-centre point should mark the location.
As a workaround, I currently use this to offset the latitude coordinate:
// From https://stackoverflow.com/a/30773300/1177562 const metersPerPixel = (latitude: number, zoomLevel: number) => { const earthCircumference = 40075017 const latitudeRadians = latitude * (Math.PI / 180) return (earthCircumference * Math.cos(latitudeRadians)) / Math.pow(2, zoomLevel + 9) } export const getLatitudeDegreesOffset = (latitude: number, pixels: number, zoomLevel: number) => { // https://gis.stackexchange.com/questions/2951/algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters return (metersPerPixel(latitude, zoomLevel) * pixels) / 111111 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be great if we could provide an offset for the custom markers. Something like:
This would help when we use a custom pin or flag or something where the bottom-centre point should mark the location.
As a workaround, I currently use this to offset the latitude coordinate:
The text was updated successfully, but these errors were encountered: