-
Notifications
You must be signed in to change notification settings - Fork 17
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
bug fix embed widget #345
bug fix embed widget #345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank's for implementing my suggestion.
I think it will be easier to copy paste the embed map code like this in a modal.
There are several comments that can be changed, if you don't mind.
var firstProjection = proj4('EPSG:3857'); | ||
var secondProjection = proj4('EPSG:4326'); | ||
|
||
var point_wsg84 = proj4(firstProjection, secondProjection, [{{ resource.center_x }}, {{ resource.center_y }}]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the resource has its own srid in resource.srid
. You should use this to set the projection. instead of assuming it as EPSG:4326 (use 4326 if it is empty).
geonode/maps/urls.py
Outdated
@@ -39,13 +39,17 @@ | |||
map_embed = 'map_embed' | |||
# TODO qlr for geoserver | |||
map_download_qlr = 'map_download_qlr' | |||
# TODO no implementation for geoserver | |||
map_embed_widget = 'map_embed_widget' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boney-bun I'm thinking that for this we can just put map_embed_widget
view into core geonode, because the frontend code is independent of either backend. I think it is ok to move map_embed_widget code from qgis_server_views to geonode.maps.views
CC @gubuntu
Also, @boney-bun you might be interested with this: |
Codecov Report
@@ Coverage Diff @@
## master-qgis_server #345 +/- ##
======================================================
- Coverage 49.52% 49.44% -0.08%
======================================================
Files 267 267
Lines 20453 20488 +35
Branches 2635 2643 +8
======================================================
+ Hits 10129 10130 +1
- Misses 9698 9732 +34
Partials 626 626
Continue to review full report at Codecov.
|
the previous code still encountered problem with CORS this solve the problem fix kartoza#152
embed widget link and add copy button fix kartoza#152
4a70eec
to
d5fdb98
Compare
thanks for your feedback @lucernae |
LGTM except another concern with how we are using Leaflet. We should not have to use proj4js nor do any of the projection calculations since Leaflet handles 3857 and 4326 under the hood, built in. @boney-bun did you add this? We might have to review how we do it across Kartoza. But for now try to do it the intended Leaflet way in this PR. |
@gubuntu @boney-bun Leaflet can't handle crs other than 3857 and 4326. So for some edge cases where the layer uses other crs, we need to convert it in the views (bbox, center, layer projection request to tile or wms) |
I'm half following this discussion, but we should stick to tiles stream which are always in 3857 |
Yes, what I mean is, in the django view we need to make sure that everything is converted to correct crs. |
Yes, it is. XYZ tiles are designed to be used in 3857 only, whatever the layer CRS. |
@boney-bun can you confirm that you follow along the discussion?
|
Yes, use the tile url. This URL is always in 3857. And we have caching on tiles, not on WMS. So it's better. |
yes, Geonode/GeoSAFE and QGIS server talk only 3857 or 4326 coordinates for our purposes (and almost all web mapping purposes) If another client makes a WMS request in another CRS to QGIS server, no problem. But for our Leaflet clients it's only 3857 and 4326. |
@Gustry now that's changing scope...:-) @boney-bun please just get the Leaflet working with WMS like all our other downloads, with the cruft stripped out. In fact please create a new issue to address stripping out the cruft in ALL our leaflet code that so it's not a blocker for this PR. Then create another issue to the backlog to add 'Tile layer' as an option for all downloads. But don't start work on it... |
ok, i get lost now. |
@boney-bun firstly, please reference the new issues I requested above. You can also make @lucernae's comment into a new issue: it is necessary to compute the bounding box of all the layers in a map. My comment about removing projection cruft from Leaflet is unrelated and also needs to be done. But address them in separate issues and get this PR merged so we can close #152. The other issues are all about improving under the hood code and technical debt. |
@boney-bun please reference the issues you created in your comment above |
this is not fixed on the test server. Only give an issue the testing label when it is deployed on testing and able to be tested.... |
i have just tested on testing. the steps are:
|
not working for me, see my comment in the issue (Firefox) |
ok, i managed to replicate your issue with firefox now. |
#376 should fix the bug when using firefox |
the previous code still encountered problem with CORS
this solve the problem
fix #152
the GIF: