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

dms as default option in overview-box #2050

Closed
ygorigor opened this issue Jan 15, 2021 · 15 comments
Closed

dms as default option in overview-box #2050

ygorigor opened this issue Jan 15, 2021 · 15 comments
Labels

Comments

@ygorigor
Copy link
Contributor

Description

Is there a possibility to have 'dms' selected by default in overview-box when lizmap loads?
Since MousePosition was refactored this script
lizMap.events.on({ 'uicreated': function(e) { $('lizmap-mouse-position > div.coords-unit > select').val('dms').change(); } });
is not working.

Environment

  • Lizmap version: 3.4.1
  • QGIS Server FULL version: 3.16.2
  • QGIS Desktop FULL version: 3.16.2
  • OS (Windows, Linux, MacOS, Android…): Linux
  • Browser (Firefox, Chrome…): Chrome
@Gustry
Copy link
Member

Gustry commented Jan 15, 2021

Not really answering, but maybe a linked answer : #2004

@ygorigor ygorigor changed the title dms as default in option in overview-box dms as default option in overview-box Jan 15, 2021
@3liz-bot
Copy link
Contributor

Hiya!
This issue has gone quiet. 👻
We get a few questions in the bug tracker, so we currently slowly closing issues.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.
Thanks for being a part of the Lizmap community! 🦎

@3liz-bot 3liz-bot added the stale This ticket might be closed soon label Jul 19, 2021
@gioman
Copy link
Contributor

gioman commented Oct 14, 2024

Not really answering, but maybe a linked answer : #2004

@Gustry not sure if since this 2021 ticket there is anything new about this request. Is there any configuration that can be used to achieve it?

Maybe this in QGIS project properties?

image

@3liz-bot 3liz-bot removed the stale This ticket might be closed soon label Oct 14, 2024
@ygorigor
Copy link
Contributor Author

@gioman I use this script
let coords_unit_select = document.querySelector('div.coords-unit > select'); coords_unit_select.value = 'dms'; coords_unit_select.dispatchEvent(new Event('change'));

@gioman
Copy link
Contributor

gioman commented Oct 15, 2024

@gioman I use this script
let coords_unit_select = document.querySelector('div.coords-unit > select'); coords_unit_select.value = 'dms'; coords_unit_select.dispatchEvent(new Event('change'));

@ygorigor ah cool! that goes in the js folder as any other LMWC js script?

@Gustry
Copy link
Member

Gustry commented Oct 15, 2024

Thanks @ygorigor for reporting your snippet.

Yes @gioman that's correct.

@ygorigor
Copy link
Contributor Author

@gioman I use this script
let coords_unit_select = document.querySelector('div.coords-unit > select'); coords_unit_select.value = 'dms'; coords_unit_select.dispatchEvent(new Event('change'));

@ygorigor ah cool! that goes in the js folder as any other LMWC js script?

Yes, after uicreated

@gioman
Copy link
Contributor

gioman commented Oct 15, 2024

Yes, after uicreated

@ygorigor not sure what do you mean here.

@Gustry
Copy link
Member

Gustry commented Oct 15, 2024

In your JS script, you should "listen" to some events. You need to copy/paste the snippet when the event uicreated is fired.

https://docs.lizmap.com/current/en/publish/customization/javascript.html#disable-right-click

@gioman
Copy link
Contributor

gioman commented Oct 15, 2024

@Gustry @ygorigor

so that would be

lizMap.events.on({
   uicreated: function(e) {
     let coords_unit_select = document.querySelector('div.coords-unit > select'); coords_unit_select.value = 'dms';
     coords_unit_select.dispatchEvent(new Event('change'));
   }
});

?

@ygorigor
Copy link
Contributor Author

@Gustry @ygorigor

so that would be

lizMap.events.on({
   uicreated: function(e) {
     let coords_unit_select = document.querySelector('div.coords-unit > select'); coords_unit_select.value = 'dms';
     coords_unit_select.dispatchEvent(new Event('change'));
   }
});

?

Yes

@gioman
Copy link
Contributor

gioman commented Oct 16, 2024

@Gustry @ygorigor
thanks! works fine for "dms" but not for "dd", any idea?

@josemvm
Copy link
Collaborator

josemvm commented Oct 16, 2024

thanks! works fine for "dms" but not for "dd", any idea?

@gioman try 'degrees'

@ygorigor
Copy link
Contributor Author

ygorigor commented Oct 17, 2024

@gioman look at values

image

@gioman
Copy link
Contributor

gioman commented Oct 17, 2024

@gioman look at values

@ygorigor @josemvm great thanks!

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

No branches or pull requests

5 participants