Skip to main content

Selecting and highlighting line/polyline features by default.

Comments

1 comment

  • Lauren MacLean
    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

Please sign in to leave a comment.