Results highlighted by default
Hi,
Wondering if anyone has tried this? Here is what I'm after: when a user does a global search or identify, I'd like the results to be highlighted on the map by default. The only way to highlight a feature now is by clicking on the result for that feature. One by one. In silverlight viewer there is an option to select all, which applies highlighting to all results, but that is not part of the html5 interface.
So, thoughts on how to achieve this. Nice if it was something you could configure in the json config files, but I expect its not that easy.
Perhaps this can be done via a workflow that uses the "Listen for External Event" activity? Not sure what event to listen for though....
Thanks
-
Zorba - did you ever figure this out?
I am looking for the same thing...
0 -
Nope. I was hoping for some response from the forum. I have not pursued it beyond this post though.
0 -
Zorba, Paul
I have attached a simple workflow (http://data.latitudegeo.com/community/search_highlight.zip) here to demonstrate how it can be done in the HTML5 viewer. It's quite bare-bones but it will get you started - you might want to customize it with a "capture geometry" activity to let users click on the map and use that location for your spatial searches. Here's how the highlighted results look like:
/customer/servlet/servlet.FileDownload?file=00P6000000em1aPEAQ
Hope this helps,
--Alejandro
0 -
Hi Alejandro,
Thanks for the reply. I dont think this is quite what I'm looking for though. This example shows how to highlight a featureset which has been created via a query task. I'm interested in highlighting features returned via the identify or global search tools. In that case you dont have a query task or a featureset object which you can access, unless I'm missing something. Also, it would have to be event driven, rather than a workflow which the user initiates.
Any thoughts on that?
0 -
what about something like this...just listen to when the collection closes, which I thing means the collection is complete. I'm pretty sure the collection gets filled from a search, workflow, identify, etc.
not tested, and you'd need to clear out the hightlights first. might give you some ideas at least?
viewer.eventRegistry.event("SiteInitializedEvent").subscribe(this, function (site) {
0 -
Thanks for the suggestion Colin. I have not delved into the api, but this looks like a useful start. One question: the collection created when you search or identify is called FSMCollection? Is that right?
0 -
Zorba,
Did you ever come up with a solution for highlighting features using the identify tool? I am also trying to find a solution for this.
Thanks, Barbara
0 -
No, just have not had a chance to pursue this yet. Good luck.
0 -
"when you search or identify is called FSMCollection? Is that right?"
Yeah, that is what is used when trapping the events: they all seem to be FSMCollection then the action
I just stuck this code in an out of the box viewer in Index.html. Put it after this chunk:
--> paste this stuff
It highlights all the records when I do an identify
0 -
sorry, missed a line to clear out highlights from previous highlighting
anyways, not sure if this helps
0 -
Brilliant! Finally had a chance to try this and it works perfect. Any identify or search features are highlighted on map with default highlight symbol.
Thanks Colin.
0 -
This is great!
Thanks Colin.
0 -
Version 2.5.1 of the html5 viewer is organized differently. Most of the javascript is removed from the index.html file into separate js files. I'm looking into how to implement this behavior with this new organization, but its kind of hard to figure out. There is a js file loaded: <script src="Resources/Compiled/loader.js"></script> but the loader.js file is compiled and no easy way to understand what it's doing. Anyone figured this out? Thanks. 0 -
I'm having an issue with this solution also highlighting markups from the measure tool. Is there a way to restrict the highlighting to non-markup layers. Thanks 0 -
We would also like to implement this directly from a Global Search or Identify without having to use a Workflow. Has anyone worked this out using the current viewer version for HTML5? 0 -
To add to my comment above, ie., I would like to be able to choose which of my layers is the default layer to highlight on map click using Identify, without having to go to the results list and click on a result to get the highlight. For example, if the Identify on map click produces 14 results, and each time you get a parcel polygon as a result, I automatically want the parcel polygon to highlight, before any clicks in the result list. 0 -
Christina, 0 -
I would like to implement this as well, but I am not sure where to add the suggested code. I cannot find the block of code that Colin suggest to add his code after. Can someone point me to which file/script to edit? Thanks 0 -
Using the Geocortex Essentials 4.4.0 and HTML5 2.5. There are the Workflow and LACounty sample sites in the package. I believe that is the things we are looking for. The active/visible layres are highlighted when mouse click on the map. However, I've no idea how to make it work by comparing the Desktop.Json.js and Manager setting between my site and sample site. 0 -
Updated... You need to turn on the MapTip check box on the layers. Then, it's wokring. 0 -
Has anyone figured out how to do this with the Geocortex Essentials 4.4.x and HTML5 2.5? I am specifically looking for a highlight when using the identify tool. It will highlight the selected area when I simply click on the map (without the identify tool selected), but not when I use the identify tool. 0 -
I'd be interested in knowing how this works as well. 0 -
Great answer Colin however I didn't like it highlighting the features when I was measuring. I altered your code slightly to stop this from happening. 0 -
I'm not able to get this code to work. I am on Essentials 4.0.0, HTML Viewer 2.0. 0 -
Jeff what file did you add this code to? I'm using Viewer 2.6.1. 0 -
Krystal, this code doesn't work in any of the more recent versions. supposedly they are fixing it soon so that you can choose pushpins or highlight by default, but we were told it would be in hte latest release and it is not. 0 -
Hi Krystal, Sorry for the late reply but hopefully this can help you and others. Here is how Jeff and I have dealt with the highlighting issue. We have made it so that all the features are highlighted by default and if you click on a feature it shows in a different color. In the script area of index.html under the var viewerConfig add the following: 0 -
This is absolutely fantastic Brian thank you!!! works like a charm. We like our initial selection to persist while the user looks at individual feature details, was easily able to tweak your code to do that too 0 -
Hi Lauren, 0 -
Hi, 0
Please sign in to leave a comment.
Comments
30 comments