AnsweredAssumed Answered

Change the symbol displayed for Search widget - highlight question

Question asked by schlot on Jul 23, 2015
Latest reply on Jul 28, 2015 by schlot

I wanted to be able to use my own icon for the Search widget, so I changed the source as:

   var searchTool = new Search ({
     map:map,
          minCharacters: 8, 
          countryCode: "US", 
          searchExtent:startExtent
   }, dom.byId('searchDiv'));

   var sources = [];

   sources.push({
    locator: new Locator("//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),
    singleLineFieldName: "SingleLine",
    outFields: ["Addr_type"],
    name: "World Geocode Service",
    localSearchOptions: {
      minScale: 300000,
      distance: 50000
    },
    placeholder: "Enter an address or place",
    highlightSymbol: new PictureMarkerSymbol(geoSymbol).setOffset(9, 18)
  });
   searchTool.set("sources", sources);
   searchTool.startup();

 

I also have a popup defined as

 highlightMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22,
    new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
    new Color([255,255,0]), 2),new Color([255,255,0,0.5]));

 highlightFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 
    new Color([255,200,0]), 2), new Color([255,255,0,0.50]));
  var popup = new Popup({
markerSymbol: highlightMarkerSymbol}, domConstruct.create("div"));

   map = new Map("mapDiv", { 
    infoWindow: popup,
    basemap: "streets",
    center: [-92.593, 38.5],
    zoom: 7
   }); 

 

I  need the popup for other sections of my code.

 

Every time I use the Search, I see both the orange flag I defined for the symbol, as well as the yellow highlighted circle I have defined in my popup.

 

If I add the parameter enableHighlight:false to my definition, that removes my flag symbol only and I still have my yellow highlightMarkerSymbol.  This is the opposite of what I want to happen.

 

Am I missing a parameter in my Search constructor or misreading what some of the parameters are for?

Outcomes