renderMap being called multiple times. Need to use once.

Created on 26 February 2025, about 2 months ago

Problem/Motivation

I can see that renderMap is being called multiple times in mapbox.renderer.js as once is not being used.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dahousecat
  • 🇬🇧United Kingdom dahousecat

    To ensure that renderMap() is only called once per mapbox_renderer settings instance I have introduced a requirement where an id property must be set on the settings object.

    E.g. mapbox_renderer[0].id

    This id matches the id of the field wrapper.

    This allows targeting that element using once, to ensure settings are only bound once.

    As a result of this MapboxFormatter from the mapbox_field module will also need to be updated.

    I'm working on patching a number of issues in that module so will include that update there.

  • 🇬🇧United Kingdom dahousecat

    I see, the ID was already there as the key, but it's just mapbox_field was not setting the key.

    Updated the patch to use the ID from the settings key.

Production build 0.71.5 2024