Shared Samples

WebGIS enables powerful geospatial web applications and services that securely share your organization’s rich geospatial data, and provides tools to deeply examine spatial data and create value added products, on demand. Please note a HGDN subscription is required to download code samples
Showing results for 
Search instead for 
Do you mean 

Add Google Location API in the livesearch control

by Technical Evangelist ‎09-09-2015 04:05 AM - edited ‎10-15-2015 07:03 AM (2,716 Views)


This example allows to add in the livesearch control a custom dispatcher based in Google search engine.




Search Dispatchers

Search dispatchers are registered in Web.Config file under webclient section:

    <Dispatcher code="all" dispatcherType="Intergraph.WebSolutions.Core.WebClient.Platform.Search.AllMapServicesSearchDispatcher"/>
    <Dispatcher code="selective" dispatcherType="Intergraph.WebSolutions.Core.WebClient.Platform.Search.ServiceSelectiveSearchDispatcher"/>
    <Dispatcher code="parsing" dispatcherType="Intergraph.WebSolutions.Core.WebClient.Platform.Search.QueryParsingDispatcher"/>

Values set to \"code\" parameter can be then used in configuration of LiveSearch and GazetteerPanel controls (as \"entryPointCode\" property). 

There are three predefined search dispatchers:

  • AllMapServicesSearchDispatcher - input is passed to all registered \"searchable\" map services
  • ServiceSelectiveSearchDispatcher - input is passed to those \"searchable\" map services, which ids are passed as a parameter
  • QueryParsingDispatcher - services that input will be passed to are chosen depending on the format of the input string Writing Custom Search Dispatcher

Search Handler

Both LiveSearch and GazeteerPanel controls use the same search handler - SearchHandler.WebClient.ashx. Handler expects the following parameters:

ep (mandatory) action (mandatory - \"search\") start (optional - pagination) limit (optional - pagination) Only \"final\" processing of the results like pagination is handled directly by the handler. The actual search process is defined by a dispatcher object. Dispatchers can expect custom parameters (for example when they are called from a custom or \"hacked\" search control), which are passed from search handler without changes.

For example, predefined dispatchers expect this parameter allMapServiceIds which is used to determine if map services from client session match map services from server session and if the session is valid.

Source code


Implementing Google MapServiceConfigProvider interface - code

To use it:

Add GoogleSearcher to newMapServiceTypes in web.config to be able to register your map service
Add GoogleSearcher assembly to assemblyLoader section in web.config so that Portal’s type scanner can use classes from your DLL.

on ‎06-10-2016 09:15 AM

What do I need to compile the source code so that I can add it to the Portal?

Thank you

‎06-13-2016 08:25 AM - edited ‎06-13-2016 08:26 AM

References to the below must be added when compiling the code: