Skip to content
New issue

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

Other controls are added to the map-overlay if they are added after the OverviewMap Control #1

Open
arnaudleclerc opened this issue Feb 16, 2021 · 1 comment

Comments

@arnaudleclerc
Copy link

This issue is for a: (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  • Add an OverviewMap control to the map
  • Add another type of control to the map

The secondly added control is added inside the overlay of the OverviewMap control

Mention any other details that might be useful

This only affect the controls added after the OverviewMap control. If the OverviewMap control is the last added, everything works fine.

//Wait until the map resources are ready.
map.events.add('ready', function () {
    // The compass is added on the top-right corner of the map
    map.controls.add(new atlas.control.CompassControl(), {
        position: 'top-right'
    });

    //Add the bring data into view control to the map.
    map.controls.add(new atlas.control.OverviewMap(), {
        position: 'top-left'
    });

    // The style control will be added to the bottom-right corner of the overlay
    map.controls.add(new atlas.control.StyleControl(), {
        position: 'bottom-right'
    });
});

image

@rbrundritt
Copy link
Contributor

rbrundritt commented Nov 10, 2022

This is a bit of a crazy bug. It seems this occurs to any control added to the map that has a right position when the overview map control has a left position. Digging deeper into this the root cause of this is in the Azure Maps Web SDK itself. Digging through the source code of the Azure Maps Web SDK, it is looking up the control container for the position using a CSS class name, and if there is more than one, using the first one. When the position is left, the first div container is for the first map, but when the position is right, the second div container is for the first map since the overview map is in the DOM before the control container for right positioned controls in the first map. I'll pass this feedback on to the Azure Maps team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants