aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hampl <kopomir@gmail.com>2018-07-19 10:56:18 +0100
committerJakub Hampl <kopomir@gmail.com>2018-07-19 10:56:18 +0100
commitac80a58b1b43a492e0df854be2636958e4739d24 (patch)
tree7787ed30cce846a2ff54e155fde8fe26131ab7ca
parent23c3623bda77a4601cfec3dfd7d9961b7d4fb83c (diff)
Un-expose the incoming port stuff
I’m less convinced about the actual usecases for these, so I’d like to wait for feedback on these.
-rw-r--r--docs/MapCommands.md46
-rw-r--r--examples/MapCommands.elm20
-rw-r--r--src/Mapbox/Cmd/Option.elm7
-rw-r--r--src/Mapbox/Cmd/Template.elm9
4 files changed, 15 insertions, 67 deletions
diff --git a/docs/MapCommands.md b/docs/MapCommands.md
index 37621f3..c1d7eea 100644
--- a/docs/MapCommands.md
+++ b/docs/MapCommands.md
@@ -1,6 +1,6 @@
# MapCommands
-This module has a bunch of essentially imperative commands for your map.
+Tell your map to do something! Most of these Commands tell your map to (with or without animation) to show a different location. You can use the options from `Mapbox.Cmd.Option` to configure these.
#### `id : String`
@@ -75,12 +75,6 @@ Supported options:
- `screenSpeed`
- `maxDuration`
-#### `stop : Cmd msg`
-
-Stops any animated transition underway.
-
-## Fitting bounds
-
#### `fitBounds : List (Option { ... }) -> ( LngLat, LngLat ) -> Cmd msg`
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.
@@ -94,41 +88,15 @@ Supported options:
- `maxZoom`
-## Right-to-left
-
-#### `setRTLTextPlugin : String -> Cmd msg`
-
-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.
-
-
-## Querying the map
-
-```
-type Response
- = GetBounds Int ( LngLat, LngLat )
- | QueryRenderedFeatures Int (List Value)
- | Error String
-```
-
-#### `queryResults : (Response -> msg) -> Sub msg`
-
-Receive results from the queries.
-
-
-#### `getBounds : Int -> Cmd msg`
-
-Responds with the map's geographical bounds. Takes a numerical ID that allows you to associate the question with the answer.
-
-### `queryRenderedFeatures : Int -> List (Option { layers : S, filter : S, query : S }) -> Query -> Cmd msg`
+#### `stop : Cmd msg`
-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.
+Stops any animated transition underway.
-The 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).
-Each 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.
+## Other
-Features 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.
+#### `resize : Cmd msg`
-The 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).
+Resizes the map according to the dimensions of its container element.
-Because 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.
+This command must be sent after the map's container is resized, or when the map is shown after being initially hidden with CSS.
diff --git a/examples/MapCommands.elm b/examples/MapCommands.elm
index b77cbf7..3eabc69 100644
--- a/examples/MapCommands.elm
+++ b/examples/MapCommands.elm
@@ -1,28 +1,18 @@
-port module MapCommands exposing (id, panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop, fitBounds, setRTLTextPlugin, Response, queryResults, getBounds, queryRenderedFeatures)
+port module MapCommands exposing (id, panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop, fitBounds, resize)
-{-| This module has a bunch of essentially imperative commands for your map.
+{-| Tell your map to do something! Most of these Commands tell your map to (with or without animation) to show a different location. You can use the options from `Mapbox.Cmd.Option` to configure these.
@docs id
### Moving the map around
-@docs panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop
+@docs panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, fitBounds, stop
-### Fitting bounds
+### Other
-@docs fitBounds
-
-
-### Right-to-left
-
-@docs setRTLTextPlugin
-
-
-### Querying the map
-
-@docs Response, queryResults, getBounds, queryRenderedFeatures, Query
+@docs resize
-}
diff --git a/src/Mapbox/Cmd/Option.elm b/src/Mapbox/Cmd/Option.elm
index 3e2a889..2e3321d 100644
--- a/src/Mapbox/Cmd/Option.elm
+++ b/src/Mapbox/Cmd/Option.elm
@@ -1,4 +1,4 @@
-module Mapbox.Cmd.Option exposing (duration, easing, offset, animate, curve, minZoom, speed, screenSpeed, maxDuration, center, zoom, bearing, pitch, around, padding, Padding, linear, maxZoom, layers, filter, intersectsPoint, intersectsBox)
+module Mapbox.Cmd.Option exposing (duration, easing, offset, animate, curve, minZoom, speed, screenSpeed, maxDuration, center, zoom, bearing, pitch, around, padding, Padding, linear, maxZoom)
{-|
@@ -23,11 +23,6 @@ Options common to `jumpTo`, `easeTo`, and `flyTo`, controlling the desired locat
@docs padding, Padding, linear, maxZoom
-
-### Querying rendered features
-
-@docs layers, filter, intersectsPoint, intersectsBox
-
-}
import Mapbox.Helpers exposing (encodePair)
diff --git a/src/Mapbox/Cmd/Template.elm b/src/Mapbox/Cmd/Template.elm
index 0889c29..4d412d5 100644
--- a/src/Mapbox/Cmd/Template.elm
+++ b/src/Mapbox/Cmd/Template.elm
@@ -1,4 +1,4 @@
-module Mapbox.Cmd.Template exposing (Id, Outgoing, Option, Supported, panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop, fitBounds, setRTLTextPlugin, queryResults, getBounds, queryRenderedFeatures, resize)
+module Mapbox.Cmd.Template exposing (Id, Outgoing, Option, Supported, panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop, fitBounds, resize)
{-| This module has a bunch of essentially imperative commands for your map.
@@ -21,12 +21,7 @@ You can of course customize the module you copy into your codebase to support th
### Other
-@docs setRTLTextPlugin, resize
-
-
-### Querying the map
-
-@docs queryResults, getBounds, queryRenderedFeatures
+@docs resize
-}