Skip to content

Ability to render multiple maps with same options #62

@roelandwyns

Description

@roelandwyns

Hi,

We have the following use case:

  • a background map where we pass an image with some boundaries.
  • multiple feature maps that we render on the background.

Staticmaps calculates the bounds for displaying the map based on the features on that map individually on the render. This means that if we have features that are outside of the boundaries of the background map, the centerX, centerY and zoom are recalculated and this does not work very well when overlaying the maps on each other. (Misaligned features on the background image).

What we do now as a fix for this is getting the { centerX, centerY, zoom } out of the background map, and using them in the render of the feature maps. (after re-converting x with xToLon and y using yToLat).
This works perfectly, however it is not the cleanest.

  • We have to use the xToLon, yToLat out of staticmaps to re-convert as a conversion happens in staticmaps when passing the center to a map render. Converting back- and forth all the time might not be the cleanest. Export of this helper function is missing in the types.
  • These 3 properties (centerX, centerY and Zoom) are not public on a map (and we need to use them). Would be nice if we could get this centerX, centerY already converted back as well.

If needed, we can also look into creating a PR if you tell me your thoughts on this idea :) .

Kind regards,

Roeland

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions