-
Notifications
You must be signed in to change notification settings - Fork 16
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
change OpenMapSurfer_Roads basemap to terrain #537
Conversation
@boney-bun does this remove the base maps even at Layer detail page, Because this also affects the thumbnail generation where the basemap is empty |
Codecov Report
@@ Coverage Diff @@
## 2.8.x #537 +/- ##
=======================================
Coverage 57.75% 57.75%
=======================================
Files 49 49
Lines 2720 2720
Branches 301 301
=======================================
Hits 1571 1571
Misses 1068 1068
Partials 81 81 Continue to review full report at Codecov.
|
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.
Why we don't use OSM as default basemap?
I'm not sure why you add Terrain
in this page?
Could you use the same logic from Layer details to include set of basemaps taken from the settings file?
Yes @lucernae we just need to have a basemap that we know always works. OSM basemap would be nice to have it as the default and the terrain can still be added as a second option for people who do want to change |
Yeah, argh sorry for not being clear :D. If I read my comment above again, it seems I'm complaining about the In last year's sprint, we already fixed this problem by offloading the basemap to settings, so we made this: https://github.com/kartoza/geonode/blob/2.8.x-qgis_server/geonode/client/templates/leaflet/layers/layer_leaflet_map.html#L142 (in kartoza/geonode repo) The layer detail page takes extra basemaps from the settings module. I suggest that:
The settings that I was talking about: https://github.com/kartoza/geonode/blob/2.8.x-qgis_server/geonode/settings.py#L1015 It would be nice if we can handle all these |
yes, the default is |
the basemaps are taken from settings. @lucernae @NyakudyaA could you review again? |
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.
Nice @boney-bun , Does it also cover the layer details page where the default will be OSM
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.
LGTM @boney-bun , thank you :).
Could you check my suggestion too in your local environment first.
The aim is to have the default basemap automatically taken from the first TILES config if defined, if not, use default osm.
attribution: '{{ tile.2|safe }}' | ||
}); | ||
{% endfor %} | ||
{% endif %} |
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.
{% endif %} | |
default_basemap = base_maps["{{ LEAFLET_CONFIG.TILES.0 }}"]; | |
{% endif %} |
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.
changes it into:
default_basemap = base_maps["{{ LEAFLET_CONFIG.TILES.0.0 }}"];
zIndex: 0, | ||
noWrap: true, | ||
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' | ||
}); | ||
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
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.
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
var default_basemap = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
map = L.map('map', { | ||
layers: [OpenMapSurfer_Roads], | ||
layers: [osm], |
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.
layers: [osm], | |
layers: [default_basemap], |
attribution: 'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' | ||
}); | ||
map.addLayer(OpenMapSurfer_Roads); | ||
map.addLayer(osm); |
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.
map.addLayer(osm); | |
map.addLayer(default_basemap); |
thanks for the feedback @lucernae @NyakudyaA |
fix ##531