MapStore (offline) - restrict zoom level when searching (eg: points)

219 views
Skip to first unread message

Silviu

unread,
Jan 13, 2020, 5:35:31 AM1/13/20
to mapstore-users
Hello MapStore,
and a Happy New Year!!!

I have a Mapstore implantation that work 100% offline. 
But, at this step I need to solve the next problem - when I search an object in the map, the selected result is zoomed in at a default scale, E.g. search for a point - Zoom in the map goes at the default scale 1:282.

Because I have a Cache Render with local Cache I have no date at that zoom level and I do not intend to build more cache levels. My last cache level is at the scale  1:2257 

1. It is possible to restrict the zoom level or scale when for the search function? 
2. Practically, I don't need the map to zoom farther then 1: 2257 when scroll.


Thank you!


Silviu

unread,
Jan 13, 2020, 10:30:38 AM1/13/20
to mapstore-users
Hello, 

I have an update:

1. It is possible to restrict the zoom level or scale when for the search function?  - SOLVED

I have identified zoomextend in mapstore.js. 0, 21 and modified to 0,18.


Thank you!



First po

Lorenzo Natali

unread,
Jan 14, 2020, 3:55:39 AM1/14/20
to mapstor...@googlegroups.com
Good,
about the point 2, you can take a look to the documentation of Map plugin, looking for "mapConstraints". This configuration in localconfig.json root allows you to limit zoom and area where you can pan/zoom:

"mapConstraints": {
 "minZoom": 12, // minimal allowed zoom used by default
 "crs":"EPSG:3857", // crs of the restrictedExtent
 "restrictedExtent":[ // limits the area accessible to the user to this bounding box
   1060334.456371965,5228292.734706056,
   1392988.403469052,5503466.036532691
  ],
  ...
 }

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/15147931-e109-4d73-afa6-5ecb12753500%40googlegroups.com.

Mihai Ionita

unread,
Jan 14, 2020, 4:43:57 AM1/14/20
to mapstor...@googlegroups.com
Hello Lorenzo, 

Thank you, I will try that and let you know.

Thanks!!!!

tigr...@gmail.com

unread,
Mar 17, 2021, 2:39:40 PM3/17/21
to mapstore-users
Hello. Is there any place online where this is best documented?

I'm following the instructions from https://mapstore.geo-solutions.it/mapstore/docs/api/plugins#plugins.Map as you suggested.

You suggested altering the localconfig.json file (where in the project is this file located?) and add mapConstraints object with an restrictedExtend field. Though, as I understand, such setup would apply to the whole application, correct?

That's not what I need. I'm in need of setting up limits to each layer individually by providing a given restricting 'bounding box' to each, accordingly.

To make things worse, I need to apply this to the MapStore under my GeoNode docker instance, so I'm not sure if this works through simple changes to some config files, or if I'd have to, for instance, clone the MapStore project, customize it with these changes, compile it and plug it to my GeoNode instance, instead of the default MapStore or something.

Any help much appreciated. Best regards.

Lorenzo Natali

unread,
Mar 18, 2021, 6:12:10 AM3/18/21
to mapstore-users
Hi,
In the most recent version of MapStore (202.01.01) we added the visibility limits for WMS layers. Home this fits your needings.

screenshot-dev.mapstore2.geo-solutions.it-2021.03.18-11_09_59.png

Lorenzo Natali

unread,
Mar 18, 2021, 6:14:03 AM3/18/21
to mapstore-users

For the bbox, there is no option yet.
I'm not an expert of GeoNode but I remember that you can anyway configure limits for tile caching in GeoServer.

Pedro Guimarães

unread,
Mar 18, 2021, 7:26:06 PM3/18/21
to mapstor...@googlegroups.com
Lorenzo, restricting on GeoServer would not suffice. I assemble maps from different layers in GeoNode, including a basemap layer, and I have pages with such embedded maps.

I'd like to be able to set a restricting extent to a given map, like in the example:


Enforcing all the layers used in the map to be visible only within the given map's bounding box, when provided.

Maybe the "visibility limits for WMS" is a start, but I wonder how that works for display a map, with n layers, each in different restricting bounding boxes, how'd the resulting scrollable bounding box be for the map?

Tks.
Reply all
Reply to author
Forward
0 new messages