Revision 46de7f4c
Added by Andreas Kohlbecker almost 7 years ago
modules/cdm_dataportal/includes/maps.inc | ||
---|---|---|
135 | 135 |
$cdm_openlayers_options = array( |
136 | 136 |
'legendPosition' => '3', |
137 | 137 |
'boundingBox' => $map_settings['bbox'], |
138 |
'maxZoom' => $map_settings['maxZoom'], |
|
138 | 139 |
'aspectRatio' => $map_settings['aspect_ratio'], |
139 | 140 |
'distributionOpacity' => $map_settings['distribution_opacity'], |
140 | 141 |
'legendOpacity' => $map_settings['legend']['opacity'], |
modules/cdm_dataportal/js/map/openlayers_map.js | ||
---|---|---|
35 | 35 |
showLayerSwitcher: false, |
36 | 36 |
baseLayerNames: ["mapproxy_vmap0"], |
37 | 37 |
defaultBaseLayerName: 'mapproxy_vmap0', |
38 |
maxZoom: 4,
|
|
38 |
maxZoom: 15,
|
|
39 | 39 |
minZoom: 0, |
40 | 40 |
debug: true, |
41 | 41 |
/** |
... | ... | |
369 | 369 |
}); |
370 | 370 |
|
371 | 371 |
// zoom to the zoomToBounds |
372 |
log(" > starting zoomToExtend " + zoomToBounds, true);
|
|
372 |
log(" > starting zoomToExtend: " + zoomToBounds + ", zoomToClosestLevel: " + zoomToClosestLevel, true);
|
|
373 | 373 |
map.zoomToExtent(zoomToBounds, zoomToClosestLevel); |
374 | 374 |
|
375 |
|
|
375 | 376 |
if(map.getZoom() > opts.maxZoom){ |
376 | 377 |
map.zoomTo(opts.maxZoom); |
377 | 378 |
} else if(map.getZoom() < opts.minZoom){ |
modules/cdm_dataportal/settings.php | ||
---|---|---|
488 | 488 |
// 'height' => 512 / 2, // optimum size for OSM layers 256 |
489 | 489 |
'aspect_ratio' => 2, |
490 | 490 |
'bbox' => '', // empty to allow automatic zooming to extend |
491 |
'maxZoom' => 15, // corresponds to the default in cdm_openlayers_map.defaults |
|
491 | 492 |
'show_labels' => FALSE, |
492 | 493 |
'caption' => '', |
493 | 494 |
'distribution_opacity' => '0.5', |
... | ... | |
2844 | 2845 |
below the map from where you can copy the bbox string.</p>'), |
2845 | 2846 |
); |
2846 | 2847 |
|
2848 |
$form[CDM_MAP_DISTRIBUTION]['maxZoom'] = array( |
|
2849 |
'#type' => 'select', |
|
2850 |
'#title' => 'Max zoom level', |
|
2851 |
'#default_value' => $map_distribution['maxZoom'], |
|
2852 |
'#options' => array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) |
|
2853 |
); |
|
2854 |
|
|
2847 | 2855 |
$form[CDM_MAP_DISTRIBUTION]['show_labels'] = array( |
2848 | 2856 |
'#type' => 'checkbox', |
2849 | 2857 |
'#title' => 'Display area labels', |
Also available in: Unified diff
fix #6608 removing to narrow default and allowing to define the maxZoom level per admin settings