<search> <searchlayers> <searchlayer> <url>http://oskar75:6080/arcgis/rest/services/test/Sokning/MapServer</url> <layerids>0,1,2</layerids> <searchfields>FASTIGHET,ADRESS,TEXT</searchfields> </searchlayer> </searchlayers> <zoomscale>5000</zoomscale> <labels> <searchprompt>Skriv fastighet, adress eller plats</searchprompt> <noresults>Inga träffar hittades</noresults> <searchresulttitle>Sökträff</searchresulttitle> <clearfeaturelabel>Rensa</clearfeaturelabel> </labels> <symbols> <simplemarkersymbol color="0x00FFFF" alpha="0.7" size="10"/> <simplefillsymbol color="0x00FFFF" alpha="0.5"> <outline alpha="0.9" width="2"/> </simplefillsymbol> </symbols> </search>
Solved! Go to Solution.
I really like the idea of the new searchbox in the HeaderControllerWidget, but I'm not able to configuring it as I want. Don't know if I'm doing it wrong or if it's impossible without changing the source code.
I want to use my own searchlayers and no locator at all, and I want the results to display as graphics.
First of all I think the conceptual graphic in the documentation is wrong, it looks like the <labels> tag and <symbols> tag is supposed to be in the <searchlayer> tag, but in the text it says they should be in the <search> tag which seems to be correct.
My config-file looks like this (the search tag):<search> <searchlayers> <searchlayer> <url>http://oskar75:6080/arcgis/rest/services/test/Sokning/MapServer</url> <layerids>0,1,2</layerids> <searchfields>FASTIGHET,ADRESS,TEXT</searchfields> </searchlayer> </searchlayers> <zoomscale>5000</zoomscale> <labels> <searchprompt>Skriv fastighet, adress eller plats</searchprompt> <noresults>Inga träffar hittades</noresults> <searchresulttitle>Sökträff</searchresulttitle> <clearfeaturelabel>Rensa</clearfeaturelabel> </labels> <symbols> <simplemarkersymbol color="0x00FFFF" alpha="0.7" size="10"/> <simplefillsymbol color="0x00FFFF" alpha="0.5"> <outline alpha="0.9" width="2"/> </simplefillsymbol> </symbols> </search>
The search works fine for my three layer ids but also displays searchresult from what I guess is the default locator. Is there anyway to disable that?
I don't see any graphics to my results though, is something wrong with my <symbols> tag? (My layers are one polygon layer and two point layers).
My last wish I think would require editing the source code (maybe something for the next version?), I would like the resultlist to display and update while typing, without pressing enter, after the users has entered a number of characters (for example 4 or 5).
No it doesn't. I have no problems with the extent och projecting, the map zooms to the correct location and show to info window, It's the result graphic that doesn't show when mouse clicking in the result list. When using keyboard arrows and enter the graphic shows up.