Hoppa till huvudinnehållet

Events for Global search

Kommentarer

2 kommentarer

  • Malcolm Walker
    • Community-Manager
    Hi Torbjørn,

     

    Search modules emit a SearchProgressEvent (as you've found) which provides a SearchProgressEventArgs object that contains information about the progress.  Each type of provider that accepts input from the global search box may generate these events.

     

    To zoom to the extent of selected/found feature(s), you could listen for the SearchProgressEvent, and when an Event occurs that matches up to what you want to observe, you can get the results attribute which references a FeatureSetCollection.  FeatureSetCollection objects have a member featureSets that is a reference to the features returned.

     

    Alternatively, you could add a command to the Results module configuration, in the resultMappings section.  These commands accept a FeatureSetCollectionID argument (a string), and would then be able to obtain the feature set collection by its ID and get the extent of all featuresets from that.

     

    Either way you will be creating some custom client code, but neither method would require you to create a custom search provider.

     

    The SDK Samples viewer provided in the Viewer for HTML5 download has a sample of handling map events (under Mapping -> Map Event Handling).  Changing the event from MapClickedEvent to SearchProgressEvent will help you get on your way!

     

    Regards,

     

    -Malcolm
    1
  • Permanently deleted user
    This post is a bit old now but could someone (Malcolm?) provide an example of how to actually get the results attribute?  I have a custom module that is subscribed properly to the SearchProgressEvent but I'm not sure what to do from there.

     

    I'm trying to accomplish exactly what Torbjørn described - zooming to the results of a global search.  My thinking was to have my custom component listen for the SearchProgressEvent (as indicated by Malcolm) and have it determine the extent of the feature(s) and zoom to it.
    0

Du måste logga in om du vill lämna en kommentar.