3liz / lizmap-javascript-scripts

Scripts for Lizmap Web Client
Mozilla Public License 2.0
22 stars 42 forks source link

JS script “GoogleStreetView.js” does not work under 3.8.2 #81

Closed guenterw closed 3 weeks ago

guenterw commented 5 months ago

What is the question? (in English)

In version 3.8.0-rc2 the JS script (GoogleStreetView.js) does not work. Even the corresponding symbol for the position in the map does not appear. Instead, the pop-up window opens

image

Project "Test BürgerGIS 3.8.0 /Test WebGIS-Projekt Bauleitplanung' under https://cx21-8.webgis.biz

Versions, safeguards, check summary etc

Versions :

List of safeguards :
* Mode : normal * Allow parent folder : yes * Number of parent : 2 folder(s) * Prevent other drive : no * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes

Check Lizmap plugin

Operating system

Ubuntu 20.04

Browsers

Chrome

Browsers version

125.0.6422.142

Relevant log output

No response

gioman commented 5 months ago

@guenterw Probably this should go (also?) here https://github.com/3liz/lizmap-javascript-scripts/issues if it isn't there already.

josemvm commented 2 months ago

hi @rldhont can you take a look at this script, please? thanks in advance

josemvm commented 1 month ago

hi, i would really like to migrate my projects to LWC 3.8(.2) but without rehabilitating this script it is not possible for me no errors appears in the browser console to try to debug the problem can someone help me please?

thanks

Gustry commented 1 month ago

Hi @josemvm

I'm sorry that the script is not compatible with LWC 3.8 but we had to add a disclaimer about this repository on the main readme.md : https://github.com/3liz/lizmap-javascript-scripts/blob/master/README.md#important-note-about-versions-contributions-and-maintainability We would be happy to find a technical solution for these "external" scripts, on which we do not have any control, tests, or development continuity.

can someone help me please?

Well, you can start by sharing the error it self. As usual, open your developper tools report any error, progress.

Gustry commented 1 month ago

In LWC 3.8.2, the user now invited to open its developper tools in case of error. This is of course not optimal, but better than nothing.

nworr commented 1 month ago

Quick code analysis : the openlayer map objet and Vector object are kind of OpenLayer 2

There's no error because the ol2 map is no more visible since LizmpaWebClient 3.8,

code should be refacto to use ol>2 classes

josemvm commented 1 month ago

no errors appears in the browser console to try to debug the problem

@nworr thanks

hoping that someone with the right skills can adapt the code! ;-)

guenterw commented 1 month ago

@josemvm , I can only agree with that. For me, this is also a knock-out criterion for the changeover with customer projects that are used to the function.

Gustry commented 1 month ago

Side note related to this situation :

i would really like to migrate my projects to LWC 3.8(.2) but without rehabilitating this script it is not possible for me

For me, this is also a knock-out criterion for the changeover with customer projects that are used to the function.

I know it's not the same, but it's kind of similar. A plugin hosted on https://plugins.qgis.org does not forward the responsibility to https://qgis.org to maintain the plugin. It's up to the plugin author to update, maintain or not this plugin.

Some of these scripts on this GIT repository have been :

If you rely on these scripts, please consider funding, maybe an integration in core. So some unit tests can be added, to avoid regression in the future.

That's why we added this paragraph in the readme.md. We were thinking quickly to rename this repository to user-contributed-javascript ? Anyway, thanks in advance for your testing on Lizmap Web Client.

guenterw commented 1 month ago

@Gustry, You are absolutely right! I also wrote this from my own personal perspective (or that of my customers). I'm happy to be convinced otherwise, but version 3.8 doesn't bring any real improvement over version 3.7 for my area of application. That's why we can continue to work well with the (very good) version 3.7. For me, version 3.7 has the huge advantage of using QGIS themes compared to older versions.

But the comparison with QGIS is correct. There, too, I stayed with older versions because extensions no longer worked in the newer ones (especially when I switched to version 3). At some point, these were available again or you change your workflow or have to invest yourself as mentioned. It's just very individual. Nevertheless, it is important and good that Lizmap is constantly evolving and uses the latest libraries. I am happy to support this with testing.

cfsgarcia commented 1 month ago

I have tweaked GoogleStreetView plugin to work with lizmap viewer 3.8.1 and later:

https://github.com/cfsgarcia/lizmap-web-client/blob/master/3liz_plugins/GoogleStreetView.js

Gustry commented 1 month ago

Great, thanks. Can you provide a pull request? You can update the existing file, rename it GoogleStreetView_3.8.js. And we can make a copy of the existing one and rename it GoogleStreetView_3.7.js at the end of the filename.

mdouchin commented 1 month ago

@cfsgarcia +1 please create a pull request with your changes, so that your work is integrated in this repository

mdouchin commented 4 weeks ago

I edited @Gustry previous comment (name of the files)

Gustry commented 3 weeks ago

Thanks @cfsgarcia, fixed in #88

guenterw commented 3 weeks ago

Thank you very much! The StreetView display in the window works. image https://cx21-8.webgis.biz/index.php/view/map?repository=buergergis8&project=bauleitplanung_3_8

Previously (in V3.7) you could still move the triangle on the map afterwards. I still can't do that in V3.8. Do I have to pay attention to something special or edit the js file accordingly?

The control works well via the Street View window.

It also works in 3.9 and 3.10, but here the pop-up window also opens: https://cx21-9.webgis.biz/index.php/view/map?repository=buergergis9&project=bauleitplanung_3_9 https://cx21-10.webgis.biz/index.php/view/map?repository=buergergis9&project=bauleitplanung_3_10

cfsgarcia commented 3 weeks ago

You can drag and drop the marker around map. It may not be ovious enough though: when you hover the marker with the cursor of your mouse you should see a blue feature showing up in the center of the marker, that's the anchor that allows you to catch it and move it around. Then you're right, it seems like the mapclick event opening up popups still propagates. Will need a tweak.

guenterw commented 3 weeks ago

@cfsgarcia, thank you for your feedback. Indeed. But you have to click on the marker first, then the blue circle appears and you can move it. Without this short click, you only ever move the map.

cfsgarcia commented 3 weeks ago

The selection marker shows up whenever hovering at my end. I've tried in Chrome and Edge. What browsers are you using?

guenterw commented 3 weeks ago

behaves like this under the current Chrome, Firefox and Edge (Win10 64bit). After placing the marker for the first time, no blue circle can be seen and it cannot be moved: image

After clicking on the marker, the blue circle is visible and can be moved: image

cfsgarcia commented 2 weeks ago

I've had a quick look at your app https://cx21-10.webgis.biz/index.php/view/map?repository=buergergis9&project=bauleitplanung_3_10.

It seems a bit messy in there. Switching to debugger mode, I can see both streeview plugins are present: old one and new one. Both calling initGoogleStreetView() funciton. Every method ends up being called twice. This may explain why it's dynsfunctioning.

I suggest you ensure only the new plugin is used in that webapp, see if it helps.

guenterw commented 2 weeks ago

You are absolutely right. Thank you for pointing this out. I renamed the new version and forgot to delete the old one. Sorry for the inconvenience. It also works fine in V3.9 and V3.10. Thank you very much.

cfsgarcia commented 2 weeks ago

I've also carried out a tweak to stop the popups from opening when dropping the streetview marker onto the map: https://github.com/3liz/lizmap-javascript-scripts/pull/90

guenterw commented 2 weeks ago

Thanks for the hint. I will test it. I also wanted to test the display on tablet more closely. On 11" Samsung the Google Street View window was very small. I may write another issue about this

guenterw commented 2 weeks ago

the current version (#90) does not work for me in 3.8, 3.9, 3.10. Maybe I am doing something wrong? See above for sample applications. Could a version number be noted somewhere or have I just not seen it?

cfsgarcia commented 2 weeks ago

Oh yes my bad. A variable had an underscore. Different between my plugin and the one here in git. Fixed here: https://github.com/3liz/lizmap-javascript-scripts/pull/91

guenterw commented 2 weeks ago

Without underscore it works in version 3.9 and 3.10. It also works in version 3.8, but you have to click on the symbol once to move it.

In all three versions, the symbol is not visible when raster data or WMS services are active.

Raster data: image

WMS service: image

In version 3.7 it works with the triangle image

cfsgarcia commented 2 weeks ago

Good point. Was using mainLizmap.map.addLayer to add the gsv layer to the map: doesn't allow the layer to be placed on top of raster layers. Adding it now via mainLizmap.map.addToolLayer to ensure it's top layer at all time. https://github.com/3liz/lizmap-javascript-scripts/pull/92

Gustry commented 2 weeks ago

@cfsgarcia Please keep one PR opened. I will merge both, but one open PR is fine ;-) I was waiting for your signal on #91

Gustry commented 2 weeks ago

I have merged @cfsgarcia, thanks for your contributions ;-)

guenterw commented 2 weeks ago

@cfsgarcia, great, thank you very much for your work. #92 works perfectly in all three versions. Also in the V8 with the moving of the symbol

Is there a requirement that it should also work on mobile devices? If so, should I open a new issue? At the moment it looks like this on a Samsung Tab S8+ with Chrome:

V3.8: image

image

V3.9: image

image

In V3.10, mobile use for Lizmap does not yet work properly (there is an open window over the map)

cfsgarcia commented 1 week ago

@Gustry sorry I may have created another PR. All the others seem to be closed. This PR https://github.com/3liz/lizmap-javascript-scripts/pull/93 may help framing GSV pano better when switching to media mode.