-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Zoom to features with a max scale constraint #4897
base: master
Are you sure you want to change the base?
Conversation
69fc9de
to
6fde4c4
Compare
6fde4c4
to
2ee3906
Compare
0a4357e
to
666a3f6
Compare
666a3f6
to
e4b1946
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove lizMap
from LocateByLayer
module.
constructor() { | ||
this._locateByLayerConfig = lizMap.config.locateByLayer; | ||
const locateBtn = document.getElementById('button-locate'); | ||
if (mainLizmap.initialConfig.locateByLayer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor() { | |
this._locateByLayerConfig = lizMap.config.locateByLayer; | |
const locateBtn = document.getElementById('button-locate'); | |
if (mainLizmap.initialConfig.locateByLayer) { | |
/** | |
* Build the lizmap LocateByLayer instance | |
* @param {LocateByLayerConfig} locateByLayer - The lizmap locateByLayer config | |
* @param {WfsFeatureType[]} vectorLayerFeatureTypeList - The list of WFS feature type | |
* @param {Map} map - OpenLayers map | |
* @param {object} lizmap3 - The old lizmap object | |
*/ | |
constructor(locateByLayer, vectorLayerFeatureTypeList, map, lizmap3) { | |
this._map = map; | |
this._vectorLayerFeatureTypeList = vectorLayerFeatureTypeList; | |
this._lizmap3 = lizmap3; | |
this._lizmap3LocateByLayerConfig = lizmap3.config.locateByLayer; | |
const locateBtn = document.getElementById('button-locate'); | |
if (locateByLayer) { |
for (var lname in this._locateByLayerConfig) { | ||
if ('order' in this._locateByLayerConfig[lname]) | ||
locateByLayerList[this._locateByLayerConfig[lname].order] = lname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (var lname in this._locateByLayerConfig) { | |
if ('order' in this._locateByLayerConfig[lname]) | |
locateByLayerList[this._locateByLayerConfig[lname].order] = lname; | |
for (var lname in this._lizmap3LocateByLayerConfig) { | |
if ('order' in this._lizmap3ocateByLayerConfig[lname]) | |
locateByLayerList[this._lizmap3ocateByLayerConfig[lname].order] = lname; |
var locateContent = []; | ||
for (var l in locateByLayerList) { | ||
var lname = locateByLayerList[l]; | ||
var lConfig = lizMap.config.layers[lname]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var lConfig = lizMap.config.layers[lname]; | |
var lConfig = this._lizmap3.config.layers[lname]; |
var lname = locateByLayerList[l]; | ||
var lConfig = lizMap.config.layers[lname]; | ||
var html = '<div class="locate-layer">'; | ||
html += '<select id="locate-layer-' + lizMap.cleanName(lname) + '" class="label">'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
html += '<select id="locate-layer-' + lizMap.cleanName(lname) + '" class="label">'; | |
html += '<select id="locate-layer-' + this._lizmap3.cleanName(lname) + '" class="label">'; |
|
||
var featureTypes = lizMap.mainLizmap.initialConfig.vectorLayerFeatureTypeList; | ||
if (featureTypes.length == 0) { | ||
this._locateByLayerConfig = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._locateByLayerConfig = {}; | |
this._lizmap3LocateByLayerConfig = {}; |
this.getLocateFeature(lname); | ||
} | ||
$('.btn-locate-clear').click(function () { | ||
lizMap.mainLizmap.map.clearHighlightFeatures(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lizMap.mainLizmap.map.clearHighlightFeatures(); | |
this._map.clearHighlightFeatures(); |
*/ | ||
zoomToLocateFeature(aName) { | ||
// clear highlight layer | ||
lizMap.mainLizmap.map.clearHighlightFeatures(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lizMap.mainLizmap.map.clearHighlightFeatures(); | |
this._map.clearHighlightFeatures(); |
lizMap.mainLizmap.map.setHighlightFeatures(data.features[0], "geojson"); | ||
}).fail(function(){ | ||
lizMap.mainLizmap.map.setHighlightFeatures(feat, "geojson"); | ||
}); | ||
} | ||
// zoom to extent | ||
lizMap.mainLizmap.map.zoomToGeometryOrExtent(geom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lizMap.mainLizmap.map.setHighlightFeatures(data.features[0], "geojson"); | |
}).fail(function(){ | |
lizMap.mainLizmap.map.setHighlightFeatures(feat, "geojson"); | |
}); | |
} | |
// zoom to extent | |
lizMap.mainLizmap.map.zoomToGeometryOrExtent(geom); | |
this._map.setHighlightFeatures(data.features[0], "geojson"); | |
}).fail(function(){ | |
this._map.setHighlightFeatures(feat, "geojson"); | |
}); | |
} | |
// zoom to extent | |
this._map.zoomToGeometryOrExtent(geom); |
} | ||
$('#locate .menu-content').html(locateContent.join('<hr/>')); | ||
|
||
var featureTypes = lizMap.mainLizmap.initialConfig.vectorLayerFeatureTypeList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var featureTypes = lizMap.mainLizmap.initialConfig.vectorLayerFeatureTypeList; | |
var featureTypes = this._vectorLayerFeatureTypeList; |
@@ -167,6 +168,7 @@ export default class Lizmap { | |||
this.legend = new Legend(); | |||
this.search = new Search(); | |||
this.tooltip = new Tooltip(); | |||
this.locateByLayer = new LocateByLayer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.locateByLayer = new LocateByLayer(); | |
this.locateByLayer = new LocateByLayer( | |
this.initialConfig.locateByLayer, | |
this.initialConfig.vectorLayerFeatureTypeList, | |
this.map, | |
this._lizmap3 | |
); |
No description provided.