Configure geocode/search bar to drop pins for results?

2609
5
09-17-2015 12:19 PM
ColeAndrews
Occasional Contributor III

Anyone been able to modify the geocode/search bar to drop pins for search results and/or create an operational layer? I've found some documentation for .NET coding but don't have enough JS knowledge to make it work for WAB.

Add geocoding to your app—ArcGIS Runtime SDK for .NET | ArcGIS for Developers

Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Cole,

  can you elaborate some more on your requirement? Currently the Search widget adds a simplemarkersymbol to the map when you click on the suggested results for a geocoder, and if you have a featurelayer configured it adds that features geometry to the map.

ColeAndrews
Occasional Contributor III

Robert-- Thanks for brining this to my attention. We are still running the Geocode widget (legacy), which doesn't seem to place the marker symbol. I just looked into the Search widget (new), which does appear to drop the marker symbol.

What would be required to do the following:

  • Change the marker symbol to something else, specifically a pushpin symbol?
  • Have the marker symbol remain as new locations are searched for? More specifically, all search result pushpins remain on a users map until the session is closed. Our users have specifically request the ability to search for numerous locations and have pushpin marker be present at all locations for a session. Would this require configuring the featurelayer as mentioned above?
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Cole,

Change the marker symbol to something else, specifically a pushpin symbol?

Depends on if you are changing a FeatureLayer source or a Geocoder source

Look at the highlightSymbol constructor option for the Search Dijit

Have the marker symbol remain as new locations are searched for? More specifically, all search result pushpins remain on a users map until the session is closed. Our users have specifically request the ability to search for numerous locations and have pushpin marker be present at all locations for a session. Would this require configuring the featurelayer as mentioned above?

You can get the highlightGraphic from the Search Dijit and add it to a separate GraphicsLayer in your map that way it will not get cleared when the widget selects the next result and would remain for the WAB session.

ColeAndrews
Occasional Contributor III

Which file in WAB would you look to change the marker symbol that is currently used for the search widget in dev v1.3?

This is a somewhat different request than above. All search widget functionality would remain as-is, just need the marker symbol changed.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Cole,

  Actually the advice is the same the highlightSymbol in the dijits constructor is what is used to define the symbol that is placed on the map when clicking on a search result.

  In the search widgets widget.js file find the startup function and you will see where the search dijit is constructed:

              this.searchDijit = new Search({

                activeSourceIndex: searchSouces.length === 1 ? 0 : 'all',

                autoSelect: false,

                enableButtonMode: false,

                enableLabel: false,

                enableInfoWindow: true,

                showInfoWindowOnSelect: true,

                map: this.map,

                sources: searchSouces,

                theme: 'arcgisSearch'

              });

You would need to add the highlightSymbol parameter to the above constructor and give it an appropriate symbol object like a picturemarekersymbol or a simplemarkersymbol.

0 Kudos