Who rated this article

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,422 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.

Who rated this article