Selecting and highlighting line/polyline features by default.
I've got a viewer with a few layers on it. One of the layers, my feature layer, has a whole bunch of lines and polylines.
I've gone in and set the pixel tolerance of Identify up a few, messed around with a few things, and when I click on a feature, it properly shows the selected feature over in the results pane but it's not highlighted. Highlit. Whatever. At least, not until I click on its name over in said pane.
I definitely want it highlight and selected.
I was able to do something goofy, attaching a module to MapClickedEvent, then firing off a buffered search on the mappoint, HighlightEsriFeatureSet, etc, but that seems excessively convoluted for what should be a simple operation.
What am I missing? Something in my desktop.json?
-
There is a substantial thread on this here: https://support.geocortex.com/essentialsGSCForum?sub-nav=forum&main-nav=essentials&feedtype=SINGLE_QUESTION_DETAIL&criteria=ALLQUESTIONS&id=9066000000007YiAAI
but for the html viewer, essentially you need to tack a bit of code on the end of the index.html
function notifyLoaded(){this.onInitialized= function (viewer) {
viewer.eventRegistry.event("FSMCollectionClosedEvent").subscribe(this, function (args) {
if (args.featureSetCollection) {
console.log(args.featureSetCollection);
if(args.featureSetCollection.id != "Measurement"){
viewer.commandRegistry.command("ClearHighlights").execute();
viewer.commandRegistry.command("RemoveHighlightLayer").execute("CustomHighlight");
dojo.forEach(args.featureSetCollection.featureSets.get(), function (featureSet) {
viewer.commandRegistry.command("HighlightFeatureSet").execute(featureSet);
}, this);
}
}
});
viewer.event("ResultsListFeatureClickedEvent").subscribe(this, function (Feature) {
console.log(Feature);
// This will create a highlight layer and highlight the click feature
viewer.commandRegistry.command("RemoveHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("CreateHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("SetHighlightBorderColor").execute("#FF4286f4");
viewer.commandRegistry.command("SetHighlightFillColor").execute("#994286f4");
viewer.commandRegistry.command("SetActiveHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("HighlightFeature").execute(Feature);
viewer.commandRegistry.command("SetHighlightBorderColor").execute("#FFFF0000");
viewer.commandRegistry.command("SetHighlightFillColor").execute("#33FF0000");
viewer.commandRegistry.command("SetActiveHighlightLayerDefault").execute();
});
viewer.event("ResultsTableFeatureClickedEvent").subscribe(this, function (Feature) {
console.log(Feature);
// This will create a highlight layer and highlight the click feature
viewer.commandRegistry.command("RemoveHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("CreateHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("SetHighlightBorderColor").execute("#FF4286f4");
viewer.commandRegistry.command("SetHighlightFillColor").execute("#994286f4");
viewer.commandRegistry.command("SetActiveHighlightLayer").execute("CustomHighlight");
viewer.commandRegistry.command("HighlightFeature").execute(Feature);
viewer.commandRegistry.command("SetHighlightBorderColor").execute("#FFFF0000");
viewer.commandRegistry.command("SetHighlightFillColor").execute("#33FF0000");
viewer.commandRegistry.command("SetActiveHighlightLayerDefault").execute();
});
}
}
new geocortex.essentialsHtmlViewer.ViewerLoader().loadAndInitialize(new notifyLoaded());0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar