Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release_3_7] [Bugfix] lizMap.getFeaturePopupContentByFeatureIntersection choosing scale #4726

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading