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

feature: external url control with regular links #2071

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

dahlalex
Copy link
Contributor

@dahlalex dahlalex commented Nov 6, 2024

Aims to fix #2064
Linked with #330

Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM

@dahlalex
Copy link
Contributor Author

dahlalex commented Nov 12, 2024

I wonder how can I control the display order of external links Conttrol on the map?

I've specified the desired order (which is first) in index.json file, but the external links control is still rendering in a different order. Is there a way to ensure that the control I've placed first in the index.json file is also displayed first on the map?

position

@steff-o
Copy link
Contributor

steff-o commented Nov 13, 2024

In general the controls should be added in the configured order but there are some controls that are "default" and are added before the "non-default".

The default controls are (from origo.js):

 defaultControls: [
   { name: 'localization' },
   { name: 'scaleline' },
   { name: 'zoom' },
   { name: 'rotate' },
   { name: 'attribution' },
   { name: 'fullscreen' }
 ]

Not all of them are in the left toolbar so they don't matter but I can't find any explanation to why home control comes before externalurl.

@dahlalex
Copy link
Contributor Author

dahlalex commented Nov 13, 2024

Thank you for your explanation.

I've consulted with a colleague, and it appears that the order of the home and externalurl controls is determined by their categorization.

Specifically, home is classified as a navigation control, while externalurl is considered a map tool.

According to the origo/src/components/main.js, navigation controls are rendered before map tools, which explains the observed order.

it seems that controlling the specific order of these controls is beyond the scope of this particular pull request.
This could be an interesting topic to explore in future discussions.

@steff-o
Copy link
Contributor

steff-o commented Nov 13, 2024

Alrighty! I missed that subtle part where controls either calls getMain().getNavigation() or getMain().getMapTools() or the other ones to get their parent element.

@dahlalex dahlalex merged commit 857c527 into master Nov 18, 2024
4 checks passed
@dahlalex dahlalex deleted the external-links-control-open-regular-links branch November 18, 2024 16:43
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

Successfully merging this pull request may close these issues.

External url Control: Ability to open regular external links that do not require map coordinates
3 participants