3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
260 stars 143 forks source link

map extent #786

Open robibrazze opened 6 years ago

robibrazze commented 6 years ago

I setting in box initial map extent "set from project properties" but in the webmap it is possible move the background' map out of the setting. I tried setting "set from map canvas" but it is the same.

Tanks

rldhont commented 6 years ago

Can you provide some URL and configuration ? Thanks

robibrazze commented 6 years ago

http://94.130.187.94/webgis/index.php/view/map/?repository=repo1&project=fontanili1

rldhont commented 6 years ago

I invite you to define a larger max scale. You defined the max scale to 70000, but this scale is to small to covering the extent you defined.

robibrazze commented 6 years ago

Ok, now the max scale is 100000, but I would like the map to be blocked at the viewing limits http://94.130.187.94/webgis/index.php/view/map/?repository=repo1&project=fontanili1

rldhont commented 6 years ago

We have made the restrictedExtent olarger than the mapExtent to easily explore the limit of the map. If you want to have that the restrictedExtent is the same as the mapExtent, you can use your one JavaScript file to do it. https://docs.3liz.com/en/publish/advanced_lizmap_config.html#adding-your-own-javascript

lizMap.events.on({
   uicreated: function(e) {
      lizMap.map.restrictedExtent = lizMap.map.maxExtent;
   }
});
wojtek19022 commented 1 month ago

I've send this piece of script to this repo: https://github.com/3liz/lizmap-javascript-scripts

Waiting for acceptance of PR https://github.com/3liz/lizmap-javascript-scripts/pull/83