Hoppa till huvudinnehållet

how to configure the search bar to zoom to results by default when the user enters a specific address

Kommentarer

4 kommentarer

  • Gareth Evans

    Hey Nakari Diaz

    I'm assuming you're referring to VertiGIS Studio Web here. The command you probably want is map.go-to-features, which will (as you might imagine) zoom the map to the current feature results.

    For context, the Search tool is configured in Designer. There, you can edit your Search component and within there configure your custom command. You can get to the Search component quickly by using the component selection tool in the upper right:

    By default the Search command content is:

    [

        "tasks.search",
      "results.display"

    ]


    So we can add in our map.zoom-to-features command.  With that extra command in there you'd have something like this:


    [

    "tasks.search",

      "map.go-to-features",

        "results.display"

    ]

    Note that you need to make it a comma-delimited list for it to be valid JSON.

    This is how it looks in action in designer in a sample app, I've searched for our office address and immediately was zoomed to the resultant feature result:

    2
  • Nakari Diaz

    Thank you so much for taking to help me with this, Gareth! This is perfect! 

    1
  • Gareth Evans

    Super welcome, Nakari!

    0
  • Mark Percy Hansen

    Would it be possible to set a fixed zoom level in the json as well?

    0

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