From 5b7ca1d3a6b608b1c31d6b06096771a1585bcbc8 Mon Sep 17 00:00:00 2001 From: Jakub Hampl Date: Thu, 21 Jun 2018 15:49:00 +0100 Subject: Add Mapbox 0.46 compatibility and features --- docs.json | 922 +++++++++++++++++++++++++++++++++++----------- package-lock.json | 6 +- package.json | 2 +- src/Mapbox/Element.elm | 23 +- src/Mapbox/Expression.elm | 22 +- src/js/main.js | 48 ++- 6 files changed, 785 insertions(+), 238 deletions(-) diff --git a/docs.json b/docs.json index 8c0265a..0898ce8 100644 --- a/docs.json +++ b/docs.json @@ -1,16 +1,436 @@ [ + { + "name": "Mapbox.Cmd", + "comment": " This module has a bunch of essentially imperative commands for your map.\n\n@docs Id, Outgoing\n\nHowever, since a published library can't have ports in it, you will need to do some setup. The easiest way to do this is to copy [this file into your app](https://github.com/gampleman/elm-mapbox/blob/master/examples/MapCommands.elm).\n\n@docs Option, Supported\n\n\n### Animation options\n\nOptions common to map movement commands that involve animation, such as panBy and easeTo, controlling the duration and easing function of the animation. All properties are optional.\n\n@docs duration, easing, offset, animate\n\n\n### Moving the map around\n\n@docs panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, curve, minZoom, speed, screenSpeed, maxDuration, stop\n\n\n### Camera Options\n\nOptions common to `jumpTo`, `easeTo`, and `flyTo`, controlling the desired location, zoom, bearing, and pitch of the camera. All properties are optional, and when a property is omitted, the current camera value for that property will remain unchanged.\n\n@docs center, zoom, bearing, pitch, around\n\n\n### Fiting bounds\n\n@docs fitBounds, padding, Padding, linear, maxZoom\n\n\n### Other\n\n@docs setRTLTextPlugin, resize\n\n\n### Querying the map\n\n@docs Response, queryResults, getBounds, queryRenderedFeatures, Query, layers, filter\n\n", + "aliases": [ + { + "name": "Id", + "comment": " Every command takes the DOM id of the map that it should operate on.\n", + "args": [], + "type": "String" + }, + { + "name": "Outgoing", + "comment": " The type of a port that you need to provide for this module to work.\n", + "args": [ + "msg" + ], + "type": "Json.Encode.Value -> Platform.Cmd.Cmd msg" + }, + { + "name": "Padding", + "comment": " ", + "args": [], + "type": "{ top : Int, right : Int, bottom : Int, left : Int }" + } + ], + "types": [ + { + "name": "Option", + "comment": " Options use phantom types to show which commands support them.\n", + "args": [ + "support" + ], + "cases": [] + }, + { + "name": "Query", + "comment": " The geometry of the query region. Either a point, a bounding box (specified in terms of southwest and northeast points), or what is currently visible in the viewport.\n", + "args": [], + "cases": [] + }, + { + "name": "Response", + "comment": " A response to the queries. See the relevant methods for more information.\n", + "args": [], + "cases": [] + }, + { + "name": "Supported", + "comment": " ", + "args": [], + "cases": [] + } + ], + "values": [ + { + "name": "animate", + "comment": " If false, no animation will occur.\n", + "type": "Bool -> Mapbox.Cmd.Option { a | animate : Mapbox.Cmd.Supported }" + }, + { + "name": "around", + "comment": " If `zoom` is specified, `around` determines the point around which the zoom is centered.\n", + "type": "Mapbox.Element.LngLat -> Mapbox.Cmd.Option { a | around : Mapbox.Cmd.Supported }" + }, + { + "name": "bearing", + "comment": " The desired bearing, in degrees. The bearing is the compass direction that is \"up\"; for example, a bearing of 90° orients the map so that east is up.\n", + "type": "Float -> Mapbox.Cmd.Option { a | bearing : Mapbox.Cmd.Supported }" + }, + { + "name": "center", + "comment": " The desired center.\n", + "type": "Mapbox.Element.LngLat -> Mapbox.Cmd.Option { a | center : Mapbox.Cmd.Supported }" + }, + { + "name": "curve", + "comment": " The zooming \"curve\" that will occur along the flight path.\nA high value maximizes zooming for an exaggerated animation, while a\nlow value minimizes zooming for an effect closer to `easeTo`.\n1.42 is the average value selected by participants in the user study discussed in [van Wijk (2003)](https://www.win.tue.nl/~vanwijk/zoompan.pdf).\nA value of `6 ^ 0.25` would be equivalent to the root mean squared average velocity. A value of 1 would produce a circular motion.\n", + "type": "Float -> Mapbox.Cmd.Option { a | curve : Mapbox.Cmd.Supported }" + }, + { + "name": "duration", + "comment": " The animation's duration, measured in milliseconds.\n", + "type": "Int -> Mapbox.Cmd.Option { a | duration : Mapbox.Cmd.Supported }" + }, + { + "name": "easeTo", + "comment": " Changes any combination of center, zoom, bearing, and pitch, with an animated transition between old and new values. The map will retain its current values for any details not specified in options.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { center : Mapbox.Cmd.Supported , zoom : Mapbox.Cmd.Supported , bearing : Mapbox.Cmd.Supported , pitch : Mapbox.Cmd.Supported , around : Mapbox.Cmd.Supported , duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Platform.Cmd.Cmd msg" + }, + { + "name": "easing", + "comment": " The name of an easing function. These must be passed to `elmMapbox`\nin the `easingFunctions` option.\n", + "type": "String -> Mapbox.Cmd.Option { a | easing : Mapbox.Cmd.Supported }" + }, + { + "name": "filter", + "comment": " A filter to limit query results.\n", + "type": "Mapbox.Expression.Expression Mapbox.Expression.DataExpression Bool -> Mapbox.Cmd.Option { a | filter : Mapbox.Cmd.Supported }" + }, + { + "name": "fitBounds", + "comment": " Pans and zooms the map to contain its visible area within the specified geographical bounds. This function will also reset the map's bearing to 0 if bearing is nonzero.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { padding : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , linear : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , maxZoom : Mapbox.Cmd.Supported }) -> ( Mapbox.Element.LngLat, Mapbox.Element.LngLat ) -> Platform.Cmd.Cmd msg" + }, + { + "name": "flyTo", + "comment": " Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight. The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { center : Mapbox.Cmd.Supported , zoom : Mapbox.Cmd.Supported , bearing : Mapbox.Cmd.Supported , pitch : Mapbox.Cmd.Supported , around : Mapbox.Cmd.Supported , duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported , curve : Mapbox.Cmd.Supported , minZoom : Mapbox.Cmd.Supported , speed : Mapbox.Cmd.Supported , screenSpeed : Mapbox.Cmd.Supported , maxDuration : Mapbox.Cmd.Supported }) -> Platform.Cmd.Cmd msg" + }, + { + "name": "getBounds", + "comment": " Responds with the map's geographical bounds. Takes a numerical ID that allows you to associate the question with the answer.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> Int -> Platform.Cmd.Cmd msg" + }, + { + "name": "jumpTo", + "comment": " Changes any combination of center, zoom, bearing, and pitch, without an animated transition. The map will retain its current values for any details not specified in options.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { center : Mapbox.Cmd.Supported , zoom : Mapbox.Cmd.Supported , bearing : Mapbox.Cmd.Supported , pitch : Mapbox.Cmd.Supported , around : Mapbox.Cmd.Supported }) -> Platform.Cmd.Cmd msg" + }, + { + "name": "layers", + "comment": " A list of style layer IDs for the query to inspect. Only features within these layers will be returned. If this parameter is not set, all layers will be checked.\n", + "type": "List String -> Mapbox.Cmd.Option { a | layers : Mapbox.Cmd.Supported }" + }, + { + "name": "linear", + "comment": " If true, the map transitions using `easeTo` . If false, the map transitions using `flyTo`.\n", + "type": "Bool -> Mapbox.Cmd.Option { a | linear : Mapbox.Cmd.Supported }" + }, + { + "name": "maxDuration", + "comment": " The animation's maximum duration, measured in milliseconds. If duration exceeds maximum duration, it resets to 0.\n", + "type": "Float -> Mapbox.Cmd.Option { a | maxDuration : Mapbox.Cmd.Supported }" + }, + { + "name": "maxZoom", + "comment": " The maximum zoom level to allow when the map view transitions to the specified bounds.\n", + "type": "Float -> Mapbox.Cmd.Option { a | maxZoom : Mapbox.Cmd.Supported }" + }, + { + "name": "minZoom", + "comment": " The zero-based zoom level at the peak of the flight path.\nIf `curve` is specified, this option is ignored.\n", + "type": "Float -> Mapbox.Cmd.Option { a | minZoom : Mapbox.Cmd.Supported }" + }, + { + "name": "offset", + "comment": " Offset of the target center relative to real map container center at the end of animation.\n", + "type": "( Int, Int ) -> Mapbox.Cmd.Option { a | offset : Mapbox.Cmd.Supported }" + }, + { + "name": "padding", + "comment": " The amount of padding in pixels to add to the given bounds.\n", + "type": "Mapbox.Cmd.Padding -> Mapbox.Cmd.Option { a | padding : Mapbox.Cmd.Supported }" + }, + { + "name": "panBy", + "comment": " Pans the map by the specified offest.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> ( Int, Int ) -> Platform.Cmd.Cmd msg" + }, + { + "name": "panTo", + "comment": " Pans the map to the specified location, with an animated transition.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Mapbox.Element.LngLat -> Platform.Cmd.Cmd msg" + }, + { + "name": "pitch", + "comment": " The desired pitch, in degrees.\n", + "type": "Float -> Mapbox.Cmd.Option { a | pitch : Mapbox.Cmd.Supported }" + }, + { + "name": "queryRenderedFeatures", + "comment": " Returns an array of GeoJSON Feature objects representing visible features that satisfy the query parameters. Takes a numerical ID that allows you to associate the question with the answer.\n\nThe response: The properties value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only string and numeric property values are supported (i.e. null, Array, and Object values are not supported).\n\nEach feature includes a top-level layer property whose value is an object representing the style layer to which the feature belongs. Layout and paint properties in this object contain values which are fully evaluated for the given zoom level and feature.\n\nFeatures from layers whose visibility property is \"none\", or from layers whose zoom range excludes the current zoom level are not included. Symbol features that have been hidden due to text or icon collision are not included. Features from all other layers are included, including features that may have no visible contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to 0.\n\nThe topmost rendered feature appears first in the returned array, and subsequent features are sorted by descending z-order. Features that are rendered multiple times (due to wrapping across the antimeridian at low zoom levels) are returned only once (though subject to the following caveat).\n\nBecause features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple times in query results. For example, suppose there is a highway running through the bounding rectangle of a query. The results of the query will be those parts of the highway that lie within the map tiles covering the bounding rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple tiles due to tile buffering.\n\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> Int -> List (Mapbox.Cmd.Option { layers : Mapbox.Cmd.Supported, filter : Mapbox.Cmd.Supported }) -> Mapbox.Cmd.Query -> Platform.Cmd.Cmd msg" + }, + { + "name": "queryResults", + "comment": " Wraps an incoming port so that you can get nicer subscritions:\n\n port elmMapboxIncoming : (Value -> msg) -> Sub msg\n\n\n -- exposed\n\n queryResults : (Response -> msg) -> Sub msg\n\n queryResuls =\n Mapbox.Cmd.queryResults elmMapboxIncoming\n\n", + "type": "((Json.Encode.Value -> msg) -> Platform.Sub.Sub msg) -> (Mapbox.Cmd.Response -> msg) -> Platform.Sub.Sub msg" + }, + { + "name": "resize", + "comment": " Resizes the map according to the dimensions of its container element.\n\nThis command must be sent after the map's container is resized, or when the map is shown after being initially hidden with CSS.\n\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> Platform.Cmd.Cmd msg" + }, + { + "name": "rotateTo", + "comment": " Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction that is \"up\"; for example, a bearing of 90° orients the map so that east is up.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Float -> Platform.Cmd.Cmd msg" + }, + { + "name": "screenSpeed", + "comment": " The average speed of the animation measured in screenfuls per second, assuming a linear timing curve. If `speed` is specified, this option is ignored.\n", + "type": "Float -> Mapbox.Cmd.Option { a | screenSpeed : Mapbox.Cmd.Supported }" + }, + { + "name": "setRTLTextPlugin", + "comment": " Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text). Necessary for supporting languages like Arabic and Hebrew that are written right-to-left. Takes a URL pointing to the Mapbox RTL text plugin source.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> String -> Platform.Cmd.Cmd msg" + }, + { + "name": "speed", + "comment": " The average speed of the animation defined in relation to `curve`. A speed of 1.2 means that the map appears to move along the flight path by 1.2 times `curve` screenfuls every second. A screenful is the map's visible span. It does not correspond to a fixed physical distance, but varies by zoom level.\n", + "type": "Float -> Mapbox.Cmd.Option { a | speed : Mapbox.Cmd.Supported }" + }, + { + "name": "stop", + "comment": " Stops any animated transition underway.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> Platform.Cmd.Cmd msg" + }, + { + "name": "zoom", + "comment": " The desired zoom level.\n", + "type": "Float -> Mapbox.Cmd.Option { a | zoom : Mapbox.Cmd.Supported }" + }, + { + "name": "zoomIn", + "comment": " Increases the map's zoom level by 1.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Platform.Cmd.Cmd msg" + }, + { + "name": "zoomOut", + "comment": " Decreases the map's zoom level by 1.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Platform.Cmd.Cmd msg" + }, + { + "name": "zoomTo", + "comment": " Zooms the map to the specified zoom level, with an animated transition.\n", + "type": "Mapbox.Cmd.Outgoing msg -> Mapbox.Cmd.Id -> List (Mapbox.Cmd.Option { duration : Mapbox.Cmd.Supported , easing : Mapbox.Cmd.Supported , offset : Mapbox.Cmd.Supported , animate : Mapbox.Cmd.Supported }) -> Float -> Platform.Cmd.Cmd msg" + } + ], + "generated-with-elm-version": "0.18.0" + }, + { + "name": "Mapbox.Element", + "comment": " This library wraps a Custom Element that actually renders a map.\n\n@docs map, css, MapboxAttr\n\n\n### Attributes\n\n@docs token, id, maxZoom, minZoom, maxBounds, LngLat, renderWorldCopies, featureState\n\n\n### Events\n\n@docs EventData, TouchEvent, eventFeaturesFilter, eventFeaturesLayers\n\n@docs onMouseDown, onMouseUp, onMouseOver, onMouseMove, onClick, onDblClick, onMouseOut, onContextMenu, onZoom, onZoomStart, onZoomEnd, onRotate, onRotateStart, onRotateEnd, onTouchEnd, onTouchMove, onTouchCancel\n\n\n### Controlled mode\n\n@docs controlledMap, Viewport\n\n", + "aliases": [ + { + "name": "EventData", + "comment": " `point` is the coordinates in pixels in screen space.\n\n`lngLat` is the coordinates as a longitude, latitude in geographic space.\n\n`renderedFeatures` is a geojson that intersect the `lngLat`:\n\nThe properties value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only string and numeric property values are supported (i.e. null, Array, and Object values are not supported).\n\nEach feature includes a top-level layer property whose value is an object representing the style layer to which the feature belongs. Layout and paint properties in this object contain values which are fully evaluated for the given zoom level and feature.\n\nFeatures from layers whose visibility property is \"none\", or from layers whose zoom range excludes the current zoom level are not included. Symbol features that have been hidden due to text or icon collision are not included. Features from all other layers are included, including features that may have no visible contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to 0.\n\nThe topmost rendered feature appears first in the returned array, and subsequent features are sorted by descending z-order. Features that are rendered multiple times (due to wrapping across the antimeridian at low zoom levels) are returned only once (though subject to the following caveat).\n\nBecause features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple times in query results. For example, suppose there is a highway running through the bounding rectangle of a query. The results of the query will be those parts of the highway that lie within the map tiles covering the bounding rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple tiles due to tile buffering.\n\n", + "args": [], + "type": "{ point : ( Int, Int ) , lngLat : Mapbox.Element.LngLat , renderedFeatures : List Json.Decode.Value }" + }, + { + "name": "LngLat", + "comment": " A longitude latitude pair (in that order).\n", + "args": [], + "type": "( Float, Float )" + }, + { + "name": "TouchEvent", + "comment": " `touches` will list stuff for every finger involved in a gesture.\n\n`center` refers to the point in the geometric center of `touches`.\n\n", + "args": [], + "type": "{ touches : List Mapbox.Element.EventData , center : Mapbox.Element.EventData }" + }, + { + "name": "Viewport", + "comment": " ", + "args": [], + "type": "{ center : Mapbox.Element.LngLat , zoom : Float , bearing : Float , pitch : Float }" + } + ], + "types": [ + { + "name": "MapboxAttr", + "comment": " This is the type that all attributes have.\n", + "args": [ + "msg" + ], + "cases": [] + } + ], + "values": [ + { + "name": "controlledMap", + "comment": " By default the map is \"uncontrolled\". By this we mean that it has its own internal state (namely the center, zoom level, pitch and bearing). This is nice if you don't care about these, but it does break some of the niceness of TEA. It also means some advanced interaction techniques are impossible to implement. For this reason we allow controlled mode where no event handlers are attached, but you need to feed the element its state. So it's up to you to implement all the user interactions. In the future, this library may help with that, but in the present this is not available.\n", + "type": "Mapbox.Element.Viewport -> List (Mapbox.Element.MapboxAttr msg) -> Mapbox.Style.Style -> Html.Html msg" + }, + { + "name": "css", + "comment": " This is literally:\n\n \n\nYou can include the required styles yourself if it fits better with the way you deploy your assets, this is meant as a quick way to get started.\n\n", + "type": "Html.Html msg" + }, + { + "name": "eventFeaturesFilter", + "comment": " By default the `renderedFeatures` property in events will return\na lot of data. If you don't need it, you can provide a filter to filter that data. This will make things more performant.\n", + "type": "Mapbox.Expression.Expression Mapbox.Expression.DataExpression Bool -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "eventFeaturesLayers", + "comment": " By default the `renderedFeatures` property in events will return\na lot of data. Here you can specify which layers you want to search for intersections. If you don't care about intersecting data at all, you can optimize performance by passing an empty list to this attribute.\n", + "type": "List String -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "featureState", + "comment": " This is a declarative API for controlling states on the features.\n\nThe API takes a bunch of GeoJSON features (these can be returned from the event listeners for example). They should at a minimum have these properties defined:\n\n - `source`\n - `sourceLayer` (only for vector sources)\n - `id` the feature's unique id\n\nThen you can give it a `List ( String, Value )` state. You can use this state infromation through the `Mapbox.Expression.featureState` expression.\n\n", + "type": "List ( Json.Decode.Value, List ( String, Json.Decode.Value ) ) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "id", + "comment": " The element's Id. This should be unique. You will need this if you want to use the Mapbox.Cmd module.\n", + "type": "String -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "map", + "comment": " A Map html element renders a map based on a Style.\n", + "type": "List (Mapbox.Element.MapboxAttr msg) -> Mapbox.Style.Style -> Html.Html msg" + }, + { + "name": "maxBounds", + "comment": " If set, the map will be constrained to the given bounds. The bounds are the `(south-west corner, north-east corner)`.\n", + "type": "( Mapbox.Element.LngLat, Mapbox.Element.LngLat ) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "maxZoom", + "comment": " The maximum zoom level of the map (0-24). Default 22.\n", + "type": "Float -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "minZoom", + "comment": " The minimum zoom level of the map (0-24).\n", + "type": "Float -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onClick", + "comment": " Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onContextMenu", + "comment": " Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onDblClick", + "comment": " Fired when a pointing device (usually a mouse) is clicked twice at the same point on the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onMouseDown", + "comment": " Fired when a pointing device (usually a mouse) is pressed within the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onMouseMove", + "comment": " Fired when a pointing device (usually a mouse) is moved within the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onMouseOut", + "comment": " Fired when a point device (usually a mouse) leaves the map's canvas.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onMouseOver", + "comment": " Fired when a pointing device (usually a mouse) is moved within the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onMouseUp", + "comment": " Fired when a pointing device (usually a mouse) is released within the map.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onRotate", + "comment": " Fired repeatedly during a \"drag to rotate\" interaction.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onRotateEnd", + "comment": " Fired when a \"drag to rotate\" interaction ends.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onRotateStart", + "comment": " Fired when a \"drag to rotate\" interaction starts.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onTouchCancel", + "comment": " Fired when a touchcancel event occurs within the map.\n", + "type": "(Mapbox.Element.TouchEvent -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onTouchEnd", + "comment": " Fired when a touchend event occurs within the map.\n", + "type": "(Mapbox.Element.TouchEvent -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onTouchMove", + "comment": " Fired when a touchmove event occurs within the map.\n", + "type": "(Mapbox.Element.TouchEvent -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onZoom", + "comment": " Fired repeatedly during an animated transition from one zoom level to another.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onZoomEnd", + "comment": " Fired just after the map completes a transition from one zoom level to another.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "onZoomStart", + "comment": " Fired just before the map begins a transition from one zoom level to another.\n", + "type": "(Mapbox.Element.EventData -> msg) -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "renderWorldCopies", + "comment": " If true, multiple copies of the world will be rendered, when zoomed out.\n", + "type": "Bool -> Mapbox.Element.MapboxAttr msg" + }, + { + "name": "token", + "comment": " Your [Mapbox API Token](https://www.mapbox.com/help/create-api-access-token/).\n", + "type": "String -> Mapbox.Element.MapboxAttr msg" + } + ], + "generated-with-elm-version": "0.18.0" + }, { "name": "Mapbox.Style", - "comment": " A Mapbox style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.\n\n@docs Style, encode\n\n\n### Light\n\n@docs Light, defaultLight\n\n\n### Transition\n\n@docs Transition, defaultTransition\n\n\n### Misc Attributes\n\n@docs MiscAttr, sprite, glyphs, name, defaultCenter, defaultZoomLevel, defaultBearing, defaultPitch, metadata\n\n", + "comment": " A Mapbox style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.\n\n@docs Style, encode , StyleDef\n\n\n### Light\n\n@docs Light, defaultLight\n\n\n### Transition\n\n@docs Transition, defaultTransition\n\n\n### Misc Attributes\n\n@docs MiscAttr, sprite, glyphs, name, defaultCenter, defaultZoomLevel, defaultBearing, defaultPitch, metadata\n\n\n### Predefined styles\n\nYou can also use one of these predefined styles.\n\n@docs streets, outdoors, light, dark, satellite, satelliteStreets\n\n", "aliases": [ { "name": "Light", - "comment": " The global light source.\n\n\n#### `anchor`\n\nWhether extruded geometries are lit relative to the map or viewport.\n\n\n### `position`\n\nPosition of the light source relative to lit (extruded) geometries, in `[r radial coordinate, a azimuthal angle, p polar angle]` where `r` indicates the distance from the center of the base of an object to its light, `a` indicates the position of the light relative to 0° (0° when the `anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and `p` indicates the height of the light (from 0°, directly above, to 180°, directly below).\n\n\n### `color`\n\nColor tint for lighting extruded geometries.\n\n\n### `intensity`\n\nIntensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.\n\n", + "comment": " The global light source.\n\n\n### `anchor`\n\nWhether extruded geometries are lit relative to the map or viewport.\n\n\n### `position`\n\nPosition of the light source relative to lit (extruded) geometries, in `[r radial coordinate, a azimuthal angle, p polar angle]` where `r` indicates the distance from the center of the base of an object to its light, `a` indicates the position of the light relative to 0° (0° when the `anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and `p` indicates the height of the light (from 0°, directly above, to 180°, directly below).\n\n\n### `color`\n\nColor tint for lighting extruded geometries.\n\n\n### `intensity`\n\nIntensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.\n\n", "args": [], "type": "{ anchor : Mapbox.Expression.Anchor , position : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) , color : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color , intensity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float }" }, { - "name": "Style", + "name": "StyleDef", "comment": " This is the core representation of a Mapbox style. It has the following keys:\n\n\n### Layers\n\nThese define what is actually rendered on screen. See the Mapbox.Layer module on how to configure these.\n\n\n### Sources\n\nThese define the data sources that feed the Layers. See the Mapbox.Source module for more.\n\n\n### Misc\n\nThese are all optional attributes.\n\nAll the other keys are values defined below.\n\n", "args": [], "type": "{ transition : Mapbox.Style.Transition , light : Mapbox.Style.Light , layers : List Mapbox.Layer.Layer , sources : List Mapbox.Source.Source , misc : List Mapbox.Style.MiscAttr }" @@ -28,9 +448,33 @@ "comment": " ", "args": [], "cases": [] + }, + { + "name": "Style", + "comment": " A mapbox style.\n\nYou can either create a style spec in Elm (for which the rest of this library is useful :) or load one from a remote URL.\n\nTo load a style from the Mapbox API, you can use a URL of the form `FromUrl \"mapbox://styles/:owner/:style\"`, where `:owner` is your Mapbox account name and `:style` is the style ID.\n\n", + "args": [], + "cases": [ + [ + "Style", + [ + "Mapbox.Style.StyleDef" + ] + ], + [ + "FromUrl", + [ + "String" + ] + ] + ] } ], "values": [ + { + "name": "dark", + "comment": " ", + "type": "Mapbox.Style.Style" + }, { "name": "defaultBearing", "comment": " Default bearing, in degrees. The bearing is the compass direction that is \"up\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\n", @@ -71,6 +515,11 @@ "comment": " A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `textField` layout property.\n", "type": "String -> Mapbox.Style.MiscAttr" }, + { + "name": "light", + "comment": " ", + "type": "Mapbox.Style.Style" + }, { "name": "metadata", "comment": " Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\n", @@ -81,10 +530,30 @@ "comment": " A human-readable name for the style.\n", "type": "String -> Mapbox.Style.MiscAttr" }, + { + "name": "outdoors", + "comment": " ", + "type": "Mapbox.Style.Style" + }, + { + "name": "satellite", + "comment": " ", + "type": "Mapbox.Style.Style" + }, + { + "name": "satelliteStreets", + "comment": " ", + "type": "Mapbox.Style.Style" + }, { "name": "sprite", "comment": " A base URL for retrieving the sprite image and metadata. The extensions .png, .json and scale factor @2x.png will be automatically appended. This property is required if any layer uses the `backgroundPattern`, `fillPattern`, `linePattern`, `fillExtrusionPattern`, or `iconImage` properties.\n", "type": "String -> Mapbox.Style.MiscAttr" + }, + { + "name": "streets", + "comment": " ", + "type": "Mapbox.Style.Style" } ], "generated-with-elm-version": "0.18.0" @@ -810,28 +1279,229 @@ "generated-with-elm-version": "0.18.0" }, { - "name": "Mapbox.Expression", - "comment": " Expressions form a little language that can be used to compute values for various layer properties.\n\nIt is recommended to import them in the following fashion:\n\n import Mapbox.Expression as E exposing (str, float, int, true, false)\n\nThis way you can use the language without much syntactic fuss and you have easy access to the literals.\n\n**Note**: If you are familiar with the JS version of the style spec,\nwe have made a few changes. Argument order has been switched for many functions to support using pipeline style more naturally. Some functions use overloading in the original, these have been renamed to\nnot be overloaded. Finally, we have chosen not to represent some parts of the spec that are superflous (especially when used form Elm), namely functions and let-in expressions.\n\n@docs Expression, DataExpression, CameraExpression\n\n@docs encode\n\n\n### Types\n\nAll of the types used as expression results are phantom (i.e. they don't have any runtime values but are used purely for compile-time checking). As such we use a mix of standard elm types for their familiarty:\n\n - `Float`\n - `String`\n - `Array`\n - `Bool`\n\nWe introduce the following types:\n\n@docs Color, Object, Collator\n\n(And also a bunch of Enum types, that will be documented in the Enums section).\n\nYou can use the following functions to transfer Elm values into the Expression language:\n\n@docs true, false, bool, int, float, str, rgba, floats, strings, object, collator, defaultCollator\n\nIn some cases, you will need to force the type system to cooperate.\nThe following assertions will force the type and cause a run-time error\nif the type is wrong:\n\n@docs assertArray, assertArrayOfStrings, assertArrayOfFloats, assertArrayOfBools, assertBool, assertFloat, assertObject, assertString\n\nYou can also use these functions to explicitly cast to a particular type:\n\n@docs toBool, toColor, toFloat, toString\n\n@docs typeof\n\n\n### Lookup\n\n@docs at, get, has, count, length\n\n\n### Feature data\n\n@docs geometryType, id, properties, getProperty, hasProperty\n\n\n### Decision\n\nThe expressions in this section can be used to add conditional logic to your styles.\n\n@docs isEqual, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual\n\nStrings can be compared with a collator for locale specific comparisons:\n\n@docs isEqualWithCollator, notEqualWithCollator,lessThanWithCollator, lessThanOrEqualWithCollator, greaterThanWithCollator, greaterThanOrEqualWithCollator\n\nLogical operators:\n\n@docs not, all, any\n\nControl flow:\n\n@docs ifElse, conditionally, matchesStr, matchesFloat, coallesce\n\n\n### Ramps, scales, curves\n\n@docs interpolate, Interpolation, step\n\n\n### String\n\n@docs append, downcase, upcase, isSupportedScript, resolvedLocale\n\n\n### Color\n\n@docs makeRGBColor, makeRGBAColor, rgbaChannels\n\n\n### Math\n\n@docs minus, multiply, divideBy, modBy, plus, raiseBy, sqrt, abs, ceil, floor, round, cos, sin, tan, acos, asin, atan, e, pi, ln, ln2, log10, log2\n\n\n### Zoom\n\n@docs zoom\n\n\n### Heatmap\n\n@docs heatmapDensity, lineProgress\n\n\n### Enums\n\nThese are required for various layer properties.\n\n@docs Anchor, anchorMap, anchorViewport, AnchorAuto, anchorAutoMap, anchorAutoViewport, anchorAutoAuto, Position, positionCenter, positionLeft, positionRight, positionTop, positionBottom, positionTopLeft, positionTopRight, positionBottomLeft, positionBottomRight, TextFit, textFitNone, textFitWidth, textFitHeight, textFitBoth, LineCap, lineCapButt, lineCapRound, lineCapSquare, LineJoin, lineJoinBevel, lineJoinRound, lineJoinMiter, SymbolPlacement, symbolPlacementPoint, symbolPlacementLine, TextJustify, textJustifyLeft, textJustifyCenter, textJustifyRight, TextTransform, textTransformNone, textTransformUppercase, textTransformLowercase\n\n", - "aliases": [], - "types": [ + "name": "Mapbox.Source", + "comment": "\n\n\n# Sources\n\n@docs Source, SourceOption\n\n@docs Id, Url\n\n\n### Vector\n\n@docs vector, vectorFromUrl, VectorSource\n\n\n### Raster\n\n@docs raster, tileSize, rasterFromUrl, RasterSource, scheme, Scheme\n\n\n### Raster DEM\n\n@docs rasterDEMMapbox, rasterDEMTerrarium\n\n\n### GeoJSON\n\n@docs geoJSONFromUrl, geoJSONFromValue, GeoJSONSource, buffer, tolerance, cluster, clusterRadius, lineMetrics\n\n\n### Image, Video & Canvas\n\n@docs Coords, image, video, staticCanvas, animatedCanvas\n\n\n### Tiled sources\n\nTiled sources can also take the following attributes:\n\n@docs bounds, minzoom, maxzoom, attribution\n\n\n### Working with sources\n\n@docs encode, getId\n\n", + "aliases": [ { - "name": "Anchor", - "comment": " ", + "name": "Coords", + "comment": " `(longitude, latitude)` pairs for the corners. You can use the type alias constructor in clockwise order: top left, top right, bottom right, bottom left.\n", "args": [], - "cases": [ - [ - "Map", - [] - ], - [ - "Viewport", - [] - ] - ] + "type": "{ topLeft : ( Float, Float ) , topRight : ( Float, Float ) , bottomRight : ( Float, Float ) , bottomLeft : ( Float, Float ) }" }, { - "name": "AnchorAuto", - "comment": " ", + "name": "Id", + "comment": " Every layer is identified by an id.\n", + "args": [], + "type": "String" + }, + { + "name": "Url", + "comment": " Represents a URL. For tiles hosted by Mapbox, the \"url\" value should be of the form mapbox://mapid.\n", + "args": [], + "type": "String" + } + ], + "types": [ + { + "name": "GeoJSONSource", + "comment": " Marks attributes that are only applicable to GeoJSON sources\n", + "args": [], + "cases": [] + }, + { + "name": "RasterSource", + "comment": " Marks attributes that are only applicable to raster sources\n", + "args": [], + "cases": [] + }, + { + "name": "Scheme", + "comment": " `XYZ`: Slippy map tilenames scheme.\n\n`TMS`: OSGeo spec scheme.\n\n", + "args": [], + "cases": [ + [ + "XYZ", + [] + ], + [ + "TMS", + [] + ] + ] + }, + { + "name": "Source", + "comment": " Sources supply data to be shown on the map. Adding a source won't immediately make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.\n", + "args": [], + "cases": [] + }, + { + "name": "SourceOption", + "comment": " Some sources can take options.\n", + "args": [ + "sourceType" + ], + "cases": [] + }, + { + "name": "VectorSource", + "comment": " Marks attributes that are only applicable to vector sources\n", + "args": [], + "cases": [] + } + ], + "values": [ + { + "name": "animatedCanvas", + "comment": " A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with an animated Canvas (i.e. one that changes over time).\n", + "type": "Mapbox.Source.Id -> String -> Mapbox.Source.Coords -> Mapbox.Source.Source" + }, + { + "name": "attribution", + "comment": " Contains an attribution to be displayed when the map is shown to a user.\n", + "type": "String -> Mapbox.Source.SourceOption any" + }, + { + "name": "bounds", + "comment": " The longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `sw.lng, sw.lat, ne.lng, ne.lat`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\n", + "type": "Float -> Float -> Float -> Float -> Mapbox.Source.SourceOption any" + }, + { + "name": "buffer", + "comment": " Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. Defaults to 128.\n", + "type": "Int -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" + }, + { + "name": "cluster", + "comment": " If the data is a collection of point features, setting this to true clusters the points by radius into groups.\n", + "type": "Bool -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" + }, + { + "name": "clusterRadius", + "comment": " Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.\n", + "type": "Float -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" + }, + { + "name": "encode", + "comment": " ", + "type": "Mapbox.Source.Source -> Json.Encode.Value" + }, + { + "name": "geoJSONFromUrl", + "comment": " A remote GeoJSON source.\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource) -> Mapbox.Source.Source" + }, + { + "name": "geoJSONFromValue", + "comment": " A GeoJSON source from some local data.\n", + "type": "Mapbox.Source.Id -> List (Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource) -> Json.Encode.Value -> Mapbox.Source.Source" + }, + { + "name": "getId", + "comment": " ", + "type": "Mapbox.Source.Source -> String" + }, + { + "name": "image", + "comment": " An image source\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Coords -> Mapbox.Source.Source" + }, + { + "name": "lineMetrics", + "comment": " Whether to calculate line distance metrics. This is required for line layers that specify `lineGradient` values.\n", + "type": "Bool -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" + }, + { + "name": "maxzoom", + "comment": " Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.\n", + "type": "Float -> Mapbox.Source.SourceOption any" + }, + { + "name": "minzoom", + "comment": " Minimum zoom level for which tiles are available, as in the TileJSON spec.\n", + "type": "Float -> Mapbox.Source.SourceOption any" + }, + { + "name": "raster", + "comment": " A raster tile source. Takes a list of one or more tile source URLs, as in the TileJSON spec.\n", + "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.RasterSource) -> Mapbox.Source.Source" + }, + { + "name": "rasterDEMMapbox", + "comment": " The [Mapbox Terrain RGB](https://blog.mapbox.com/global-elevation-data-6689f1d0ba65) DEM source.\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Source" + }, + { + "name": "rasterDEMTerrarium", + "comment": " A raster DEM source in the Terarrium format.\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.RasterSource) -> Mapbox.Source.Source" + }, + { + "name": "rasterFromUrl", + "comment": " A raster tile source configured from a TileJSON spec.\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Source" + }, + { + "name": "scheme", + "comment": " Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\n", + "type": "Mapbox.Source.Scheme -> Mapbox.Source.SourceOption Mapbox.Source.RasterSource" + }, + { + "name": "staticCanvas", + "comment": " A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with a static Canvas (i.e. one that doesn't change), as it will be cached to improve performance.\n", + "type": "Mapbox.Source.Id -> String -> Mapbox.Source.Coords -> Mapbox.Source.Source" + }, + { + "name": "tileSize", + "comment": " The minimum visual size to display tiles for this layer.\n", + "type": "Int -> Mapbox.Source.SourceOption Mapbox.Source.RasterSource" + }, + { + "name": "tolerance", + "comment": " Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance). Defaults to 0.375.\n", + "type": "Float -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" + }, + { + "name": "vector", + "comment": " A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.\n\nThis takes an array of one or more tile source URLs, as in the TileJSON spec.\n\n", + "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.VectorSource) -> Mapbox.Source.Source" + }, + { + "name": "vectorFromUrl", + "comment": " A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.\n\nThe first argument is the layers id, the second is a url to a [TileJSON specification](https://github.com/mapbox/tilejson-spec) that configures the source.\n\n", + "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Source" + }, + { + "name": "video", + "comment": " A video source. For each URL in the list, a video element source will be created, in order to support same media in multiple formats supported by different browsers.\n", + "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> Mapbox.Source.Coords -> Mapbox.Source.Source" + } + ], + "generated-with-elm-version": "0.18.0" + }, + { + "name": "Mapbox.Expression", + "comment": " Expressions form a little language that can be used to compute values for various layer properties.\n\nIt is recommended to import them in the following fashion:\n\n import Mapbox.Expression as E exposing (str, float, int, true, false)\n\nThis way you can use the language without much syntactic fuss and you have easy access to the literals.\n\n**Note**: If you are familiar with the JS version of the style spec,\nwe have made a few changes. Argument order has been switched for many functions to support using pipeline style more naturally. Some functions use overloading in the original, these have been renamed to\nnot be overloaded. Finally, we have chosen not to represent some parts of the spec that are superflous (especially when used form Elm), namely functions and let-in expressions.\n\n@docs Expression, DataExpression, CameraExpression\n\n@docs encode\n\n\n### Types\n\nAll of the types used as expression results are phantom (i.e. they don't have any runtime values but are used purely for compile-time checking). As such we use a mix of standard elm types for their familiarty:\n\n - `Float`\n - `String`\n - `Array`\n - `Bool`\n\nWe introduce the following types:\n\n@docs Color, Object, Collator\n\n(And also a bunch of Enum types, that will be documented in the Enums section).\n\nYou can use the following functions to transfer Elm values into the Expression language:\n\n@docs true, false, bool, int, float, str, rgba, floats, strings, object, collator, defaultCollator\n\nIn some cases, you will need to force the type system to cooperate.\nThe following assertions will force the type and cause a run-time error\nif the type is wrong:\n\n@docs assertArray, assertArrayOfStrings, assertArrayOfFloats, assertArrayOfBools, assertBool, assertFloat, assertObject, assertString\n\nYou can also use these functions to explicitly cast to a particular type:\n\n@docs toBool, toColor, toFloat, toString\n\n@docs typeof\n\n\n### Lookup\n\n@docs at, get, has, count, length\n\n\n### Feature data\n\n@docs featureState, geometryType, id, properties, getProperty, hasProperty\n\n\n### Decision\n\nThe expressions in this section can be used to add conditional logic to your styles.\n\n@docs isEqual, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual\n\nStrings can be compared with a collator for locale specific comparisons:\n\n@docs isEqualWithCollator, notEqualWithCollator,lessThanWithCollator, lessThanOrEqualWithCollator, greaterThanWithCollator, greaterThanOrEqualWithCollator\n\nLogical operators:\n\n@docs not, all, any\n\nControl flow:\n\n@docs ifElse, conditionally, matchesStr, matchesFloat, coalesce\n\n\n### Ramps, scales, curves\n\n@docs interpolate, Interpolation, step\n\n\n### String\n\n@docs append, downcase, upcase, isSupportedScript, resolvedLocale\n\n\n### Color\n\n@docs makeRGBColor, makeRGBAColor, rgbaChannels\n\n\n### Math\n\n@docs minus, multiply, divideBy, modBy, plus, raiseBy, sqrt, abs, ceil, floor, round, cos, sin, tan, acos, asin, atan, e, pi, ln, ln2, log10, log2\n\n\n### Zoom\n\n@docs zoom\n\n\n### Heatmap\n\n@docs heatmapDensity, lineProgress\n\n\n### Enums\n\nThese are required for various layer properties.\n\n@docs Anchor, anchorMap, anchorViewport, AnchorAuto, anchorAutoMap, anchorAutoViewport, anchorAutoAuto, Position, positionCenter, positionLeft, positionRight, positionTop, positionBottom, positionTopLeft, positionTopRight, positionBottomLeft, positionBottomRight, TextFit, textFitNone, textFitWidth, textFitHeight, textFitBoth, LineCap, lineCapButt, lineCapRound, lineCapSquare, LineJoin, lineJoinBevel, lineJoinRound, lineJoinMiter, SymbolPlacement, symbolPlacementPoint, symbolPlacementLine, TextJustify, textJustifyLeft, textJustifyCenter, textJustifyRight, TextTransform, textTransformNone, textTransformUppercase, textTransformLowercase\n\n", + "aliases": [], + "types": [ + { + "name": "Anchor", + "comment": " ", + "args": [], + "cases": [ + [ + "Map", + [] + ], + [ + "Viewport", + [] + ] + ] + }, + { + "name": "AnchorAuto", + "comment": " ", "args": [], "cases": [] }, @@ -861,7 +1531,7 @@ }, { "name": "Expression", - "comment": " Expressions are zero overhead wrappers over the underlying JSON language that attempt to provide some type safety.\n\nNote however, that while being a strictly typed language, it has slighlty different semantics tham Elm:\n\n - There is only a single number type. I have denoted it `Float`. You will notice that the `int` function takes an Elm int\n value and converts it to an `Expression expr Float`.\n - All values may be `null`. There is no `Maybe` type. You can use the `coallesce` function to handle this.\n - There is no distinction between `List`, `Array`, and tuples. Hence all collections are labeled as `Array`.\n - Dictionaries are called `Object`. The keys are always `String`, but the values can be of mixed types. Hence retrieving\n values from them makes code untyped.\n - You can force the types of things using the `assert...` functions. This will generate a runtime error if the type doesn't\n match. This should be necessary only rarely.\n\nThe `exprType` can be:\n\n - `CameraExpression`\n - `DataExpression`\n - or a type variable representing either of the above\n\nThe intent is to help you not break your style by using a DataExpression (for example) where it isn't supported. However, this isn't entirely foolproof, so some caution is advised.\n\n", + "comment": " Expressions are zero overhead wrappers over the underlying JSON language that attempt to provide some type safety.\n\nNote however, that while being a strictly typed language, it has slighlty different semantics tham Elm:\n\n - There is only a single number type. I have denoted it `Float`. You will notice that the `int` function takes an Elm int\n value and converts it to an `Expression expr Float`.\n - All values may be `null`. There is no `Maybe` type. You can use the `coalesce` function to handle this.\n - There is no distinction between `List`, `Array`, and tuples. Hence all collections are labeled as `Array`.\n - Dictionaries are called `Object`. The keys are always `String`, but the values can be of mixed types. Hence retrieving\n values from them makes code untyped.\n - You can force the types of things using the `assert...` functions. This will generate a runtime error if the type doesn't\n match. This should be necessary only rarely.\n\nThe `exprType` can be:\n\n - `CameraExpression`\n - `DataExpression`\n - or a type variable representing either of the above\n\nThe intent is to help you not break your style by using a DataExpression (for example) where it isn't supported. However, this isn't entirely foolproof, so some caution is advised.\n\n", "args": [ "exprType", "resultType" @@ -1058,7 +1728,7 @@ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float" }, { - "name": "coallesce", + "name": "coalesce", "comment": " Evaluates each expression in turn until the first non-null value is obtained, and returns that value.\n", "type": "List (Mapbox.Expression.Expression exprType outputType) -> Mapbox.Expression.Expression exprType outputType" }, @@ -1112,6 +1782,11 @@ "comment": " ", "type": "Mapbox.Expression.Expression exprType Bool" }, + { + "name": "featureState", + "comment": " Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Note that `featureState` can only be used with paint properties that support data-driven styling.\n", + "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression Mapbox.Expression.DataExpression any" + }, { "name": "float", "comment": " ", @@ -1564,206 +2239,5 @@ } ], "generated-with-elm-version": "0.18.0" - }, - { - "name": "Mapbox.Source", - "comment": "\n\n\n# Sources\n\n@docs Source, SourceOption\n\n@docs Id, Url\n\n\n### Vector\n\n@docs vector, vectorFromUrl, VectorSource\n\n\n### Raster\n\n@docs raster, tileSize, rasterFromUrl, RasterSource, scheme, Scheme\n\n\n### Raster DEM\n\n@docs rasterDEMMapbox, rasterDEMTerrarium\n\n\n### GeoJSON\n\n@docs geoJSONFromUrl, geoJSONFromValue, GeoJSONSource, buffer, tolerance, cluster, clusterRadius, lineMetrics\n\n\n### Image, Video & Canvas\n\n@docs Coords, image, video, staticCanvas, animatedCanvas\n\n\n### Tiled sources\n\nTiled sources can also take the following attributes:\n\n@docs bounds, minzoom, maxzoom, attribution\n\n\n### Working with sources\n\n@docs encode, getId\n\n", - "aliases": [ - { - "name": "Coords", - "comment": " `(longitude, latitude)` pairs for the corners. You can use the type alias constructor in clockwise order: top left, top right, bottom right, bottom left.\n", - "args": [], - "type": "{ topLeft : ( Float, Float ) , topRight : ( Float, Float ) , bottomRight : ( Float, Float ) , bottomLeft : ( Float, Float ) }" - }, - { - "name": "Id", - "comment": " Every layer is identified by an id.\n", - "args": [], - "type": "String" - }, - { - "name": "Url", - "comment": " Represents a URL. For tiles hosted by Mapbox, the \"url\" value should be of the form mapbox://mapid.\n", - "args": [], - "type": "String" - } - ], - "types": [ - { - "name": "GeoJSONSource", - "comment": " Marks attributes that are only applicable to GeoJSON sources\n", - "args": [], - "cases": [] - }, - { - "name": "RasterSource", - "comment": " Marks attributes that are only applicable to raster sources\n", - "args": [], - "cases": [] - }, - { - "name": "Scheme", - "comment": " `XYZ`: Slippy map tilenames scheme.\n\n`TMS`: OSGeo spec scheme.\n\n", - "args": [], - "cases": [ - [ - "XYZ", - [] - ], - [ - "TMS", - [] - ] - ] - }, - { - "name": "Source", - "comment": " Sources supply data to be shown on the map. Adding a source won't immediately make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.\n", - "args": [], - "cases": [] - }, - { - "name": "SourceOption", - "comment": " Some sources can take options.\n", - "args": [ - "sourceType" - ], - "cases": [] - }, - { - "name": "VectorSource", - "comment": " Marks attributes that are only applicable to vector sources\n", - "args": [], - "cases": [] - } - ], - "values": [ - { - "name": "animatedCanvas", - "comment": " A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with an animated Canvas (i.e. one that changes over time).\n", - "type": "Mapbox.Source.Id -> String -> Mapbox.Source.Coords -> Mapbox.Source.Source" - }, - { - "name": "attribution", - "comment": " Contains an attribution to be displayed when the map is shown to a user.\n", - "type": "String -> Mapbox.Source.SourceOption any" - }, - { - "name": "bounds", - "comment": " The longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `sw.lng, sw.lat, ne.lng, ne.lat`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL.\n", - "type": "Float -> Float -> Float -> Float -> Mapbox.Source.SourceOption any" - }, - { - "name": "buffer", - "comment": " Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. Defaults to 128.\n", - "type": "Int -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource" - }, - { - "name