qgis / qwc2-demo-app

QWC2 demo application
Other
243 stars 155 forks source link

&hc=1 doesn't paint the pin #351

Closed claudiadragoste closed 2 years ago

claudiadragoste commented 2 years ago

I go to Share Link, enable "show pin" and I generate the permalink; When I paste the permalink created and it contains "&hc=1", this has no effect, there is no pin on the map. Is this the expected behavior? (by the way, the qwc2 is great!!)

Thank you!

image image

manisandro commented 2 years ago

Do you have the StartupMarker plugin enabled?

claudiadragoste commented 2 years ago

Sorry for my stupid question: how can I enable it? (besides having it in AppConfig.js and in config.json)

manisandro commented 2 years ago

That's all that's needed actually

claudiadragoste commented 2 years ago

Solved!! in config.json, I had "urlPositionFormat": "extent"; changing it for "urlPositionFormat": "centerAndZoom" and it works perfect! It's great!!

manisandro commented 2 years ago

Indeed the c parameter is required, I forgot about this aspect! I've extended the Share component to ensure c is added to the URL if the pin is enabled: https://github.com/qgis/qwc2/commit/e5e28355e1c534748c00048194afc682c2d017fe

claudiadragoste commented 2 years ago

Thank you!! That's even better! I'm still wondering how you created the url with 'p' parameter. I couldn't find 5his option in the documentation. I like this compact form: http://qwc2.sourcepole.ch/?k=2ff4415c7&hc=1

manisandro commented 2 years ago

There is no standard p parameter?

claudiadragoste commented 2 years ago

Sorry, sorry, I wanted to say 'k'

manisandro commented 2 years ago

k is the permalink hash parameter. The share component automatically generates such a key if there is a permalink service active, see [1] and [2].

claudiadragoste commented 2 years ago

Oh, thank you!!