[mapserver-users] integrate variable openlayer map extent

StefanWebViewer stefan27 at hotmail.com
Thu Nov 7 01:38:39 PST 2019


Good day everybody,
thanks for the last hints. That was very helpful.
Now I have another question: 
We have created map accesses for several regions (more than 300). Each of
these regions has a different map extent. So that the respective map extent
does not have to be adapted manually, I created a .js with XMIN-YMAX for
each region. 
This looks like this: var XMIN = 123
                             var YMIN = 456 etc.

In the OpenLayers.js the map extent section looks like this:
      map = new OpenLayers.Map 
                              ('map', 
                                     { 
                                   controls:[ 
                                      new OpenLayers.Control.Navigation(), 
                                      new OpenLayers.Control.PanZoomBar(), 
                                      new
OpenLayers.Control.LayerSwitcher(), 
                                      new OpenLayers.Control.Attribution(), 
                                      new
OpenLayers.Control.MousePosition(), 
                                      new
OpenLayers.Control.OverviewMap({'size': refmapextent})], 
                                  maxExtent: new
OpenLayers.Bounds(3279012,5612977,3311313,5642977), 
                                  projection: new
OpenLayers.Projection('EPSG:31467'), 
                                      maxResolution: 'auto'} 
                                       
                              ); 
Now my goal is to make the line like this: "maxExtent: new OpenLayers.Bounds
('XMIN', 'YMIN,' XMAX ',' YMAX '),"
At the beginning of the .js I call the var on each. Unfortunately, when I do
this, no map will appear. What possibilities exist to successfully integrate
such variables? About hints I am happy as always. 
Thank you so much!



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Mapserver-User-f4226646.html



More information about the MapServer-users mailing list