Skip to content

Commit

Permalink
Merge pull request #4726 from 3liz/backport-4716-to-release_3_7
Browse files Browse the repository at this point in the history
[Backport release_3_7] [Bugfix] lizMap.getFeaturePopupContentByFeatureIntersection choosing scale
  • Loading branch information
rldhont authored Sep 3, 2024
2 parents 19c4c0c + cf70365 commit dafbf82
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions assets/src/legacy/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -3832,11 +3832,15 @@ window.lizMap = function() {
// Calculate fake bbox around the feature
var units = lizMap.map.getUnits();
var lConfig = lizMap.config.layers[aName];
if( lizMap.map.maxScale == 'auto' )
var scale = lConfig.minScale;
else
var scale = Math.max( lizMap.map.maxScale, lConfig.minScale );
scale = scale * 2;
var minMapScale = lizMap.config.options.mapScales.at(0);
var scale = Math.max( minMapScale, lConfig.minScale ) * 2;
var maxMapScale = lizMap.config.options.mapScales.at(-1);
if (maxMapScale < lConfig.maxScale && scale > maxMapScale) {
scale =scale/2 + (maxMapScale-scale/2)/2;
} else if (scale > lConfig.maxScale) {
scale =scale/2 + (lConfig.maxScale-scale/2)/2
}

var res = OpenLayers.Util.getResolutionFromScale(scale, units);

var geomType = feat.geometry.CLASS_NAME;
Expand Down

0 comments on commit dafbf82

Please sign in to comment.