Module

Leaflet

Package
purescript-leaflet-tdammers
Repository
tdammers/purescript-leaflet-tdammers

Re-exports from Leaflet.LatLng

#Longitude Source

type Longitude = Number

Geographic longitude

#Latitude Source

type Latitude = Number

Geographic latitude

#LatLngBounds Source

data LatLngBounds :: Type

Bounding rectangle in geo coordinate space.

#LatLng Source

data LatLng :: Type

Latitude / longitude pair. Leaflet.js accepts these in various flavors, but we only expose this one type.

#lng Source

lng :: LatLng -> Longitude

Extract the longitude from a LatLng

#latlng Source

latlng :: Latitude -> Longitude -> LatLng

Construct a LatLng record from separate components

#latLngBounds Source

latLngBounds :: LatLng -> LatLng -> LatLngBounds

Construct a LatLngBounds from two corners

#lat Source

lat :: LatLng -> Latitude

Extract the latitude from a LatLng

Re-exports from Leaflet.Map

#MouseEvent Source

type MouseEvent = { containerPoint :: Point, latlng :: LatLng, layerPoint :: Point }

Metadata for a mouse event.

#Layer Source

data Layer :: Type

A map layer

#setView Source

setView :: forall e. Map -> LatLng -> Zoom -> Eff (leaflet :: LEAFLET | e) Unit

Set the current view for a map.

#onZoom Source

onZoom :: forall e. Map -> e Unit -> e Unit

Subscribe to the zoom event, which fires when the map's zoom level changes.

#onMove Source

onMove :: forall e. Map -> (LatLng -> e Unit) -> e Unit

Subscribe to the move event.

#onMouseUp Source

onMouseUp :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the mouseup event (mouse button pressed)

#onMouseOver Source

onMouseOver :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the mouseover event

#onMouseOut Source

onMouseOut :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the mouseout event

#onMouseMove Source

onMouseMove :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the mousemove event

#onMouseEvent Source

onMouseEvent :: forall e. String -> Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to a mouse even by name.

#onMouseDown Source

onMouseDown :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the mousedown event (mouse button released)

#onDblClick Source

onDblClick :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the dblclick event (double click)

#onClick Source

onClick :: forall e. Map -> (MouseEvent -> e Unit) -> e Unit

Subscribe to the click event

#map Source

map :: forall e. String -> LatLng -> Zoom -> Eff (leaflet :: LEAFLET | e) Map

map domID latLng zoom creates a new map object centered at latLng, at zoom level zoom, and attaches it to the DOM element with ID domID.

#invalidateSize Source

invalidateSize :: forall e. Map -> Eff (leaflet :: LEAFLET | e) Unit

Tell a map that the size of its container may have changed, causing it to

#getZoom Source

getZoom :: forall e. Map -> Eff (leaflet :: LEAFLET | e) Zoom

Get the current zoom level.

#getCenter Source

getCenter :: forall e. Map -> Eff (leaflet :: LEAFLET | e) LatLng

Get the geographic position at which the map is currently centered.

#addLayer Source

addLayer :: forall e. Layer -> Map -> Eff (leaflet :: LEAFLET | e) Unit

Add a layer to a map

Re-exports from Leaflet.TileLayer

#UrlTemplate Source

type UrlTemplate = String

A URL template for tile layers.

#tileLayer Source

tileLayer :: forall e. UrlTemplate -> Array TileLayerOption -> Eff (leaflet :: LEAFLET | e) Layer

tileLayer template options creates a new tile layer using the URL template template to generate tile URLS.

The template can use the following variables, written between curly braces:

  • {z}: zoom level
  • {x}, {y}: the tile coordinates (after projection), from the range [0..(2 ^ z))
  • {s}: subdomain

Example: "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"

Re-exports from Leaflet.Types

#Zoom Source

type Zoom = Int

A zoom level. Zoom levels start at 0 (which means "show the whole world") and zoom in exponentially, each step corresponding to a factor of 2.

#Point Source

type Point = { x :: Pixels, y :: Pixels }

A point in 2D screen space.

#Pixels Source

type Pixels = Number

A distance in screen space, measured in logical pixels ("CSS Pixels").

#LEAFLET Source

data LEAFLET :: Effect

Anything that uses Leaflet has a LEAFLET effect.