Use this class to create a Map searcher. A Map searcher sends search requests as the user clicks, pauses or draws boxes on the map.
var searcher = new mapfish.Searcher.Map({ mode: mapfish.Searcher.Map.HOVER, url: "countries", protocol: { params: { limit: 10 } }, displayDefaultPopup: true, delay: 400 }); map.addControl(searcher); searcher.activate();
mapfish. | Use this class to create a Map searcher. |
Constants | |
EVENT_TYPES | {Array(String)} Supported event types. |
Properties | |
protocol | {OpenLayers.Protocol} A protocol instance, if not set in the config passed to the constructor, and if the url option is set, a MapFish protocol is created using the url option. |
mode | {String} Either mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER or mapfish.Searcher.Map.BOX, or mapfish.Searcher.Map.EXTENT, defaults to mapfish.Searcher.Map.CLICK. |
searchTolerance | {Integer} The search tolerance. |
searchToleranceUnits | {String} Tolerance units. |
pointAsBBOX | {Boolean} If true, the filter sent to server will be of BBOX type. |
pixelTolerance | {Integer} This property has no effect if mode is set to mapfish.Searcher.Map.BOX or to mapfish.Searcher.Map.EXTENT, and it’s meaning depends whether mode is set to mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER. |
delay | {Integer} This property has no effect if mode is set to mapfish.Searcher.Map.BOX or to mapfish.Searcher.Map.EXTENT, and it’s meaning depends whether mode is set to mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER. |
boxDivClassName | {String} The CSS class to use for drawing the box, applies only if mode is mapfish.Searcher.Map.BOX, default is olHandlerBoxZoomBox. |
displayDefaultPopup | {Boolean} Display a default popup with the search results, does not apply if mode is set to mapfish.Searcher.Map.EXTENT; defaults to false. |
onMouseMove | {Function} Method called if mode is mapfish.Searcher.Map.HOVER, when the mouse moves. |
projection | {OpenLayers.Projection} When passed the bounds or point set in the filter are reprojected. |
Constructor | |
mapfish. | options {Object} Optional object whose properties will be set on the instance. |
Constants | |
mapfish. | Set the searcher mode to this constant if you want search on click. |
mapfish. | Set the searcher mode to this constant if you want search on hover. |
mapfish. | Set the searcher mode to this constant if you want search on box drawing. |
mapfish. | Set the searcher mode to this constant if you want search on map extent. |
{Array(String)} Supported event types.
{OpenLayers.Protocol} A protocol instance, if not set in the config passed to the constructor, and if the url option is set, a MapFish protocol is created using the url option.
{String} Either mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER or mapfish.Searcher.Map.BOX, or mapfish.Searcher.Map.EXTENT, defaults to mapfish.Searcher.Map.CLICK.
{Integer} This property has no effect if mode is set to mapfish.Searcher.Map.BOX or to mapfish.Searcher.Map.EXTENT, and it’s meaning depends whether mode is set to mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER. If mode is mapfish.Searcher.Map.CLICK pixelTolerance is the maximum number of pixels between mouseup and mousedown for an event to be considered a click. If mode is mapfish.Searcher.Map.HOVER pixelTolerance is the maximum number of pixels between mousemoves for an event to be considered a pause. Default is 2 pixels.
{Integer} This property has no effect if mode is set to mapfish.Searcher.Map.BOX or to mapfish.Searcher.Map.EXTENT, and it’s meaning depends whether mode is set to mapfish.Searcher.Map.CLICK or mapfish.Searcher.Map.HOVER. If mode is mapfish.Searcher.Map.CLICK delay is the number of milliseconds between clicks before the event is considered a double-click. If mode is mapfish.Searcher.Map.HOVER delay is the number of milliseconds between mousemoves before the event is considered a pause. Default is 300.
{String} The CSS class to use for drawing the box, applies only if mode is mapfish.Searcher.Map.BOX, default is olHandlerBoxZoomBox.
{Boolean} Display a default popup with the search results, does not apply if mode is set to mapfish.Searcher.Map.EXTENT; defaults to false.
{Function} Method called if mode is mapfish.Searcher.Map.HOVER, when the mouse moves. Can be used to close a tooltip, for example. The event is passed in parameter and “this” will be the Map instance.
{OpenLayers.Projection} When passed the bounds or point set in the filter are reprojected. In order to reproject, a projection transformation function for the specified projections must be available. This support may be provided via proj4js or via a custom transformation function. See {OpenLayers.Projection.addTransform} for more information on custom transformations.
Set a custom transform method between two projections.
OpenLayers.Projection.addTransform = function( from, to, method )