# @mapcairn/sdk/browser

The `@mapcairn/sdk/browser` entry point of @mapcairn/sdk.

Checked against version 0.2.0. Import from `@mapcairn/sdk/browser`.

## Ports

- [`LayerSource`](https://docs.mapcairn.com/api/sdk/browser/LayerSource.md): Loads a feed layer's features, on request a feature's detail shapes, and what a tile layer's service says is at a tap.
- [`LocationProvider`](https://docs.mapcairn.com/api/sdk/browser/LocationProvider.md): Finds the user's location.
- [`RoutingProvider`](https://docs.mapcairn.com/api/sdk/browser/RoutingProvider.md): Finds routes and travel-time areas.
- [`SearchProvider`](https://docs.mapcairn.com/api/sdk/browser/SearchProvider.md): Finds places by name.
- [`SuggestionProvider`](https://docs.mapcairn.com/api/sdk/browser/SuggestionProvider.md): Offers places that match text the person has only partly typed.

## Functions

- [`defineMapElement`](https://docs.mapcairn.com/api/sdk/browser/defineMapElement.md): Registers the &lt;mapcairn-map> element, or one under another name.
- [`mountMap`](https://docs.mapcairn.com/api/sdk/browser/mountMap.md): Draws a map in element and returns the handle to move, change and remove it.

## Classes

- [`LayerError`](https://docs.mapcairn.com/api/sdk/browser/LayerError.md): The only error a layer source rejects with.
- [`LocationError`](https://docs.mapcairn.com/api/sdk/browser/LocationError.md): The only error a location provider throws, apart from PortAbortError.
- [`MapEngineError`](https://docs.mapcairn.com/api/sdk/browser/MapEngineError.md): The only error a map adapter rejects with when its engine cannot start, and the payload of its fatalError event when the engine stops later.
- [`MountMapError`](https://docs.mapcairn.com/api/sdk/browser/MountMapError.md): What drawing a map, its handle and an element's definition throw for a call that cannot work.
- [`PortAbortError`](https://docs.mapcairn.com/api/sdk/browser/PortAbortError.md): Thrown by an async port when the caller's AbortSignal fires before the work finishes.
- [`RoutingError`](https://docs.mapcairn.com/api/sdk/browser/RoutingError.md): The only error a routing provider rejects with.
- [`SearchError`](https://docs.mapcairn.com/api/sdk/browser/SearchError.md): The only error a search provider throws, apart from PortAbortError.

## Types

- [`AreaGeometry`](https://docs.mapcairn.com/api/sdk/browser/AreaGeometry.md): The outline of an area, as GeoJSON writes a Polygon (a ring, then any holes) or a MultiPolygon.
- [`BasemapAttributionEntry`](https://docs.mapcairn.com/api/sdk/browser/BasemapAttributionEntry.md): One credit line a tile provider requires.
- [`BasemapDefinition`](https://docs.mapcairn.com/api/sdk/browser/BasemapDefinition.md): A basemap, as data.
- [`BasemapSource`](https://docs.mapcairn.com/api/sdk/browser/BasemapSource.md): Where a basemap's pixels come from.
- [`Bounds`](https://docs.mapcairn.com/api/sdk/browser/Bounds.md): A geographic bounding box in decimal degrees.
- [`CardSpec`](https://docs.mapcairn.com/api/sdk/browser/CardSpec.md): What a feature's card shows.
- [`CategoryColour`](https://docs.mapcairn.com/api/sdk/browser/CategoryColour.md): Colour by category, for alert levels and kinds.
- [`ControlBase`](https://docs.mapcairn.com/api/sdk/browser/ControlBase.md): The fields every layer control has, whatever its kind.
- [`ControlCondition`](https://docs.mapcairn.com/api/sdk/browser/ControlCondition.md): Makes a control usable only while another control has one of some values, such as "Include smaller earthquakes" only for the hour and the day.
- [`ControlValues`](https://docs.mapcairn.com/api/sdk/browser/ControlValues.md): The value of each of a layer's controls, as strings, by control id.
- [`DateBound`](https://docs.mapcairn.com/api/sdk/browser/DateBound.md): A calendar date: an ISO YYYY-MM-DD string, or a day relative to today (UTC).
- [`DateControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/DateControlDefinition.md): A calendar day, bounded on both sides.
- [`DateTimeBound`](https://docs.mapcairn.com/api/sdk/browser/DateTimeBound.md): A slot of a date and time control: a UTC YYYY-MM-DDtHHMM string on the control's step, such as 2000-06-01t0000, or a time relative to now.
- [`DateTimeControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/DateTimeControlDefinition.md): A UTC date and a time of day on a fixed step, such as the half hours of a product the provider names by timestamp.
- [`DefinitionText`](https://docs.mapcairn.com/api/sdk/browser/DefinitionText.md): Text a definition shows a person: a MessageKey, looked up in the active catalogue where the definition is rendered; a HostText, a host's own key with its…
- [`DerivedVariable`](https://docs.mapcairn.com/api/sdk/browser/DerivedVariable.md): A URL variable computed from control values with a lookup table, for feeds whose file names combine several choices.
- [`DetailSource`](https://docs.mapcairn.com/api/sdk/browser/DetailSource.md): A second source fetched only when someone asks for it on one feature, such as an event's affected area.
- [`FeatureFilter`](https://docs.mapcairn.com/api/sdk/browser/FeatureFilter.md): Keeps the features whose decoded field equals one of in.
- [`FeedLayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/FeedLayerDefinition.md): A layer of features from a feed: points with a point style (no kind), or polygons or lines with a shapes style.
- [`FeedShapeStyle`](https://docs.mapcairn.com/api/sdk/browser/FeedShapeStyle.md): A feed shape style whose label may use a host-keyed template.
- [`FeedSource`](https://docs.mapcairn.com/api/sdk/browser/FeedSource.md): A feed: one JSON document of point features, fetched when the layer is on.
- [`FieldMap`](https://docs.mapcairn.com/api/sdk/browser/FieldMap.md): Where each decoded field comes from: a field name mapped to a dotted path into a raw feature, such as properties.mag or geometry.coordinates.2.
- [`FieldValue`](https://docs.mapcairn.com/api/sdk/browser/FieldValue.md): A decoded field value.
- [`FillPattern`](https://docs.mapcairn.com/api/sdk/browser/FillPattern.md): How a polygon is hatched, so a fill's meaning never rests on colour alone.
- [`FixedColour`](https://docs.mapcairn.com/api/sdk/browser/FixedColour.md): One colour for every feature.
- [`HeatmapLayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/HeatmapLayerDefinition.md): Point density from a feed or a query, drawn as a heatmap.
- [`HeatmapSpec`](https://docs.mapcairn.com/api/sdk/browser/HeatmapSpec.md): How a heatmap is drawn.
- [`HeatmapValue`](https://docs.mapcairn.com/api/sdk/browser/HeatmapValue.md): A number a heatmap reads: fixed in the definition, or taken from one of the layer's range controls so the person can tune it.
- [`HostText`](https://docs.mapcairn.com/api/sdk/browser/HostText.md): A host's own translatable definition text: a host-defined catalogue key and the text shown in the source language, which is also the fallback when the active…
- [`IdentifiableLayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/IdentifiableLayerDefinition.md): A raster tile layer that answers a tap.
- [`IdentifySource`](https://docs.mapcairn.com/api/sdk/browser/IdentifySource.md): Asks a service what a raster tile layer shows at a tapped place, as a WMS GetFeatureInfo request does.
- [`IdentifyTarget`](https://docs.mapcairn.com/api/sdk/browser/IdentifyTarget.md): Where a tap landed, for a tile layer's identify request.
- [`KeyedLayerText`](https://docs.mapcairn.com/api/sdk/browser/KeyedLayerText.md): A host-defined translation key and its source text for a layer template.
- [`LatLng`](https://docs.mapcairn.com/api/sdk/browser/LatLng.md): A geographic position in decimal degrees (WGS 84).
- [`LayerAttribution`](https://docs.mapcairn.com/api/sdk/browser/LayerAttribution.md): A credit line a provider asks for.
- [`LayerControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/LayerControlDefinition.md): Every kind of control a layer can offer.
- [`LayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/LayerDefinition.md): One open data layer, as data.
- [`LayerDefinitionBase`](https://docs.mapcairn.com/api/sdk/browser/LayerDefinitionBase.md): The fields every layer definition has, whatever its kind.
- [`LayerDetailRequest`](https://docs.mapcairn.com/api/sdk/browser/LayerDetailRequest.md): What LayerSource needs.
- [`LayerErrorKind`](https://docs.mapcairn.com/api/sdk/browser/LayerErrorKind.md): Why a layer could not load: the request failed (network), the response could not be decoded (invalid), it held no features (empty, which only load and…
- [`LayerFeature`](https://docs.mapcairn.com/api/sdk/browser/LayerFeature.md): One decoded feature: an id, its geometry and the fields its definition maps.
- [`LayerGeometry`](https://docs.mapcairn.com/api/sdk/browser/LayerGeometry.md): The geometry of a decoded feature: the GeoJSON types a layer can draw.
- [`LayerIdentifyRequest`](https://docs.mapcairn.com/api/sdk/browser/LayerIdentifyRequest.md): What LayerSource needs.
- [`LayerLoadRequest`](https://docs.mapcairn.com/api/sdk/browser/LayerLoadRequest.md): What LayerSource needs.
- [`LayerTemplate`](https://docs.mapcairn.com/api/sdk/browser/LayerTemplate.md): A literal layer template or a host-keyed template with source text.
- [`LineDash`](https://docs.mapcairn.com/api/sdk/browser/LineDash.md): How a line or outline is dashed.
- [`ListSort`](https://docs.mapcairn.com/api/sdk/browser/ListSort.md): A sort option for the list of loaded features.
- [`ListSpec`](https://docs.mapcairn.com/api/sdk/browser/ListSpec.md): What each row of the list of loaded features shows.
- [`LocateOptions`](https://docs.mapcairn.com/api/sdk/browser/LocateOptions.md): Options for a single location request.
- [`LocationErrorKind`](https://docs.mapcairn.com/api/sdk/browser/LocationErrorKind.md): Why finding the user's location failed.
- [`LocationFix`](https://docs.mapcairn.com/api/sdk/browser/LocationFix.md): A position fix.
- [`LocationWatchHandlers`](https://docs.mapcairn.com/api/sdk/browser/LocationWatchHandlers.md): Callbacks for a continuous watch.
- [`MapCairnMapElement`](https://docs.mapcairn.com/api/sdk/browser/MapCairnMapElement.md): The &lt;mapcairn-map> element.
- [`MapCairnMapElementClass`](https://docs.mapcairn.com/api/sdk/browser/MapCairnMapElementClass.md): The class defineMapElement registers.
- [`MapCairnMapEventMap`](https://docs.mapcairn.com/api/sdk/browser/MapCairnMapEventMap.md): The events a &lt;mapcairn-map> sends, by name.
- [`MapEngineErrorReason`](https://docs.mapcairn.com/api/sdk/browser/MapEngineErrorReason.md): Why a map failed: its engine could not start without WebGL, the engine or its basemap could not load (load-failed), the engine stopped working after it had…
- [`MapEvents`](https://docs.mapcairn.com/api/sdk/browser/MapEvents.md): What a map reports, by event name.
- [`MapFeatureHit`](https://docs.mapcairn.com/api/sdk/browser/MapFeatureHit.md): One feature of a data layer under a tap.
- [`MapFeatureTap`](https://docs.mapcairn.com/api/sdk/browser/MapFeatureTap.md): A tap or click on a point, polygon or line of a feed layer: the topmost feature, and every feature under the tap (it included), topmost first and listed once…
- [`MapHandle`](https://docs.mapcairn.com/api/sdk/browser/MapHandle.md): A map that was drawn in an element.
- [`MapLayersState`](https://docs.mapcairn.com/api/sdk/browser/MapLayersState.md): The layers of a map and whether the list is there.
- [`MapLayerState`](https://docs.mapcairn.com/api/sdk/browser/MapLayerState.md): One layer of a map, as a page reads it.
- [`MapLayerStatus`](https://docs.mapcairn.com/api/sdk/browser/MapLayerStatus.md): What a layer is doing, as a short name: off, on, loading, ready, empty, error, one of the tile layer's tiles- states, or a zoom limit.
- [`MapStore`](https://docs.mapcairn.com/api/sdk/browser/MapStore.md): Something a page can read and listen to, in the shape of LayerCatalogue: getState returns the same object until the state changes, and subscribe calls the…
- [`MapTool`](https://docs.mapcairn.com/api/sdk/browser/MapTool.md): The optional tools a page can add to the map: "search" (a search box, which needs services.search), "map-options" (the sheet with the basemaps, a pin and…
- [`MapUpdate`](https://docs.mapcairn.com/api/sdk/browser/MapUpdate.md): What MapHandle can change after the map is mounted.
- [`MarkerShape`](https://docs.mapcairn.com/api/sdk/browser/MarkerShape.md): The shapes a point marker can take, so colour is never the only signal.
- [`MeasureMode`](https://docs.mapcairn.com/api/sdk/browser/MeasureMode.md): What is being measured.
- [`MessageKey`](https://docs.mapcairn.com/api/sdk/browser/MessageKey.md): A key into the shipped message catalogue.
- [`MountAbout`](https://docs.mapcairn.com/api/sdk/browser/MountAbout.md): The About block a page adds to Help: a heading, a line of text and up to two links.
- [`MountEngineNotice`](https://docs.mapcairn.com/api/sdk/browser/MountEngineNotice.md): What a page says when its map cannot run, and what it offers to do about it.
- [`MountLanguage`](https://docs.mapcairn.com/api/sdk/browser/MountLanguage.md): A language a page adds to English, as plain data.
- [`MountLink`](https://docs.mapcairn.com/api/sdk/browser/MountLink.md): A link a page gives the map: where it goes and what it is called.
- [`MountMapErrorKind`](https://docs.mapcairn.com/api/sdk/browser/MountMapErrorKind.md): Why a call that draws or changes a map, or an element's definition, could not work:
- [`MountMapOptions`](https://docs.mapcairn.com/api/sdk/browser/MountMapOptions.md): Everything mountMap takes.
- [`MountNotes`](https://docs.mapcairn.com/api/sdk/browser/MountNotes.md): Notes a page words for what it knows and the map does not: which service answers a request and what is sent to it.
- [`MountServices`](https://docs.mapcairn.com/api/sdk/browser/MountServices.md): The providers a page writes itself.
- [`MountTour`](https://docs.mapcairn.com/api/sdk/browser/MountTour.md): A first-visit tour a page gives its map: a welcome card, steps that each end when the person does what they ask, and an ending.
- [`MountTourCard`](https://docs.mapcairn.com/api/sdk/browser/MountTourCard.md): The words of a card of the tour that is not a step.
- [`MountTourStep`](https://docs.mapcairn.com/api/sdk/browser/MountTourStep.md): One step of a tour: what TourStep of @mapcairn/core holds, with the heading and the text as plain text, a message key or text as written.
- [`NoticeAction`](https://docs.mapcairn.com/api/sdk/browser/NoticeAction.md): Which notice's button was pressed.
- [`OpacityControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/OpacityControlDefinition.md): How opaque a tile overlay is, from 0.1 to 1.
- [`PaletteSlot`](https://docs.mapcairn.com/api/sdk/browser/PaletteSlot.md): A colour from the data palette, by name (see PALETTE_SLOTS).
- [`PointStyle`](https://docs.mapcairn.com/api/sdk/browser/PointStyle.md): How a feed's points are drawn, and so what its legend says.
- [`Position`](https://docs.mapcairn.com/api/sdk/browser/Position.md): A longitude and latitude pair, in that order, as GeoJSON writes it.
- [`QuerySource`](https://docs.mapcairn.com/api/sdk/browser/QuerySource.md): A feed that is asked only for the features inside the current view, for a dataset too large to fetch whole.
- [`RangeControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/RangeControlDefinition.md): A number between two bounds, such as a heatmap's radius.
- [`ReachableAreaFeature`](https://docs.mapcairn.com/api/sdk/browser/ReachableAreaFeature.md): One area that can be reached within a time.
- [`ReachableAreaRequest`](https://docs.mapcairn.com/api/sdk/browser/ReachableAreaRequest.md): A request for the area reachable from a place within a time.
- [`ReachableAreaResult`](https://docs.mapcairn.com/api/sdk/browser/ReachableAreaResult.md): The areas reachable from an origin: usually one, and more when the network is split.
- [`RelativeDate`](https://docs.mapcairn.com/api/sdk/browser/RelativeDate.md): A date relative to today in UTC, so a definition never hard-codes a day that goes stale.
- [`RelativeTime`](https://docs.mapcairn.com/api/sdk/browser/RelativeTime.md): A time relative to now, so a definition can follow a provider's latency: \{ minutesAgo: 360 \} is six hours ago, rounded down to the control's step.
- [`RouteLeg`](https://docs.mapcairn.com/api/sdk/browser/RouteLeg.md): One stretch of a route, between two consecutive stops.
- [`RouteLineGeometry`](https://docs.mapcairn.com/api/sdk/browser/RouteLineGeometry.md): A line of [longitude, latitude] positions, as GeoJSON writes a LineString.
- [`RouteRequest`](https://docs.mapcairn.com/api/sdk/browser/RouteRequest.md): A request for a route through the stops, in order.
- [`RouteResult`](https://docs.mapcairn.com/api/sdk/browser/RouteResult.md): A route: one line feature for each leg, with totals.
- [`RoutingCredit`](https://docs.mapcairn.com/api/sdk/browser/RoutingCredit.md): A credit a routing service asks for while a route or travel-time area it found is shown, such as its data source, its own name or a link its usage terms…
- [`RoutingErrorKind`](https://docs.mapcairn.com/api/sdk/browser/RoutingErrorKind.md): Why a route or a travel-time area could not be found: the request failed (network), it was not valid (invalid), no route links the stops (no-route), the…
- [`SearchErrorKind`](https://docs.mapcairn.com/api/sdk/browser/SearchErrorKind.md): Why a place search failed.
- [`SearchOptions`](https://docs.mapcairn.com/api/sdk/browser/SearchOptions.md): Options for a search or a reverse lookup.
- [`SearchResult`](https://docs.mapcairn.com/api/sdk/browser/SearchResult.md): A place a search found.
- [`SegmentedControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/SegmentedControlDefinition.md): A choice of a few values, drawn as a segmented control.
- [`SegmentedOption`](https://docs.mapcairn.com/api/sdk/browser/SegmentedOption.md): One option of a segmented control.
- [`SetViewOptions`](https://docs.mapcairn.com/api/sdk/browser/SetViewOptions.md): Options for MapHandle.
- [`ShapeCategory`](https://docs.mapcairn.com/api/sdk/browser/ShapeCategory.md): One category of a polygon or line style.
- [`ShapeCategoryColour`](https://docs.mapcairn.com/api/sdk/browser/ShapeCategoryColour.md): Colour by category: a field's value picks the class.
- [`ShapeColour`](https://docs.mapcairn.com/api/sdk/browser/ShapeColour.md): How a polygon or line layer is coloured.
- [`ShapeFixedColour`](https://docs.mapcairn.com/api/sdk/browser/ShapeFixedColour.md): One colour for every polygon or line.
- [`ShapeIntervalColour`](https://docs.mapcairn.com/api/sdk/browser/ShapeIntervalColour.md): Graduated colour in equal intervals over a numeric field.
- [`ShapeLabel`](https://docs.mapcairn.com/api/sdk/browser/ShapeLabel.md): Text drawn on each polygon or line, filled from the feature's fields.
- [`ShapeMarks`](https://docs.mapcairn.com/api/sdk/browser/ShapeMarks.md): Marks a class can carry beside its colour.
- [`ShapeStep`](https://docs.mapcairn.com/api/sdk/browser/ShapeStep.md): One value range of a polygon or line style, from explicit stops.
- [`ShapeStepColour`](https://docs.mapcairn.com/api/sdk/browser/ShapeStepColour.md): Graduated colour from explicit stops (class breaks).
- [`ShapeStyle`](https://docs.mapcairn.com/api/sdk/browser/ShapeStyle.md): How polygons or lines are drawn: a fill (or a stroke, for lines) coloured by a rule, with outline width, hatching, dashing and labels.
- [`SizeStops`](https://docs.mapcairn.com/api/sdk/browser/SizeStops.md): Marker radius by value: the radius of the last stop at or below the value.
- [`StepColour`](https://docs.mapcairn.com/api/sdk/browser/StepColour.md): Colour by ordered value ranges, using an ordered (ordinal) palette.
- [`StyleCategory`](https://docs.mapcairn.com/api/sdk/browser/StyleCategory.md): One category of a categorical style.
- [`SuggestOptions`](https://docs.mapcairn.com/api/sdk/browser/SuggestOptions.md): Options for one suggestion request.
- [`SwitchControlDefinition`](https://docs.mapcairn.com/api/sdk/browser/SwitchControlDefinition.md): An on and off choice.
- [`ThemeChoice`](https://docs.mapcairn.com/api/sdk/browser/ThemeChoice.md): The theme the user chose.
- [`TileLayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/TileLayerDefinition.md): A raster overlay.
- [`TileSource`](https://docs.mapcairn.com/api/sdk/browser/TileSource.md): Raster tiles drawn as an overlay, such as WMTS imagery or a WMS map.
- [`TravelMode`](https://docs.mapcairn.com/api/sdk/browser/TravelMode.md): How the traveller moves, which decides the roads and the speed.
- [`VectorHeatmapLayer`](https://docs.mapcairn.com/api/sdk/browser/VectorHeatmapLayer.md): One layer of a vector tile source whose points are drawn as a heatmap.
- [`VectorShapeLayer`](https://docs.mapcairn.com/api/sdk/browser/VectorShapeLayer.md): One layer of a vector tile source, drawn as polygons or lines.
- [`VectorSourceLayer`](https://docs.mapcairn.com/api/sdk/browser/VectorSourceLayer.md): Either way a vector tile source layer can be drawn.
- [`VectorTileLayerDefinition`](https://docs.mapcairn.com/api/sdk/browser/VectorTileLayerDefinition.md): A vector tile layer: one source, drawn from one or more of its source layers, each with its own style and zoom window.
- [`VectorTileSource`](https://docs.mapcairn.com/api/sdk/browser/VectorTileSource.md): Vector tiles drawn by the map engine, styled per source layer.
- [`ViewState`](https://docs.mapcairn.com/api/sdk/browser/ViewState.md): The visible part of the map.
