# identifyUrl

The URL that asks a tile layer's service what is at a tap, as a WMS
`GetFeatureInfo` request does. The request is a small square picture,
`2 * tolerance + 1` pixels across, centred on the tapped pixel: `{width}`
and `{height}` are that size, `{x}` and `{y}` are the tolerance, and
`{bbox}` is the picture's box as `minx,miny,maxx,maxy` in EPSG:3857 metres.
Every value is encoded, so `{bbox}` goes out with its commas as `%2C`.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { identifyUrl } from "@mapcairn/core";
 
function identifyUrl(definition: IdentifiableLayerDefinition, controls: ControlValues, now: number, at: IdentifyTarget): string;
```

## Parameters

- `definition` (`IdentifiableLayerDefinition`)
- `controls` (`ControlValues`)
- `now` (`number`)
- `at` (`IdentifyTarget`)

## Returns

`string`

## Throws

- `GeometryError` `invalid` when a coordinate or the zoom is not
   finite. A plain `Error` when the template names a variable that has no
   value, which a definition that passed validation never does.

## Remarks

The box is neither clamped nor shifted at the edges of the world,
 and the server decides what it makes of one. A tap at longitude 179.9999
 gives a box that ends past the edge of the world square. Near a pole the
 box is centred on latitude 85.0511, the limit of Web Mercator, while
 `{lat}` keeps the latitude tapped. The caller wraps longitude to -180 up
 to 180 first. Numbers are rounded to a millimetre, a zoom to three
 decimals and degrees to six, and written without an exponent.

## See also

- [`IdentifiableLayerDefinition`](https://docs.mapcairn.com/api/core/IdentifiableLayerDefinition.md)
- [`ControlValues`](https://docs.mapcairn.com/api/core/ControlValues.md)
- [`IdentifyTarget`](https://docs.mapcairn.com/api/core/IdentifyTarget.md)

Source: [packages/core/src/layers/identify.ts:121](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/layers/identify.ts#L121)
