-
Notifications
You must be signed in to change notification settings - Fork 141
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
mgl-control order problem #126
Comments
I have this issue, too. See #75 |
@sroettering yup, this issue can be closed as a duplicate. Can you elaborate on the workaround you did as I have no workaround right now beside not using |
I had two options in mind as a workaround:
Option 1 is good if you are ok with changing the mapbox styling. |
Another workaround is to add |
I've ended up using an id element and ...
@ViewChildren("topLeftControl", { read: ElementRef })
public topLeftControls: QueryList<ElementRef>;
...
public onLoad() {
this.topLeftControls.forEach(c => {
this.mapComponent.mapInstance.addControl(new CustomControl(c.nativeElement), "top-left");
});
} And so I have full control on the order, option @sroettering 's option 2 basically. |
Not certain this should have been closed, as the only solutions proposed have been workarounds. |
@BAByrne I do not think there is a way to solve this 'properly' (because Angular does not give any ordering guaranetees). At least not one I could be able to come up with. If you have any idea have this might be solved - let me know (plz open a separate issue) or submit a PR. |
If have the following code:
Which creates an incorrect ordered of controls:
Removing the
*ngIf
sort this out, but this is a silly example, as I need this*ngIf
in real life.Also I've tried to place a control under the scale in case the scale control is in the right bottom and couldn't...
This is probably due to the same reason, i.e:
The following two snippets produce the same controls layout:
and:
Let me know if there's something I can do to help out.
The text was updated successfully, but these errors were encountered: