This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
helpful summary of your project, less than 80 characters
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-07-02 11:05:24 UTC
mgold/elm-geojson 2.0.0 <= v < 3.0.0 2.0.1
elm-lang/http 1.0.0 <= v < 2.0.0 1.0.0
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

Mapbox

Elm Mapbox aims to provide an easy way to interact with Mapbox web API. Using this package allows to embed a map into a webpage or retrieve tiles informations.

Usage

Predefined functions

In its more simple form, all you have to do is to use predefined functions with correct parameters, i.e. you Mapbox access_token and the correct enpoint.

import Mapbox.Maps.SlippyMap as Mapbox
import Mapbox.Endpoint as Endpoint

mapboxToken : String
mapboxToken =
    "pk.eyJ1IjoiZ2hpdmVydCIsImEiOiJjajRqbzFlcWYwajVzMzNzZTdpZXU3MTRnIn0.wSGB3LCr5OcvPqQ61BqYyg"

-- Embed a slippy map into your website and set Options, Hash and Size of the iframe.
embeddedSlippyMap : Html msg
embeddedSlippyMap =
    Mapbox.slippyMap Endpoint.streets mapboxToken Nothing Nothing (Mapbox.Size 1000 1000)

Tiles and EditorProject are returning Http.Requests GeoJson. GeoJson is a specific Json format representing geographical coordinates and data. It is defined in the package mgold/elm-geojson, and you can find additional informations on geojson.org or the RFC7946 specification.

Constructing your own requests

You may prefer to construct your own request directly to Mapbox. To do it, use Mapbox.url the different arguments are constructing urls based on the Mapbox schema, i.e. https://api.mapbox.com/{endpoint}{options}{format}?access_token={accessToken}{parameters}. Obviously, you should preferably use predefined functions, guaranting type checking and providing HTML embedding or HTTP Requests.