package leaflet

  1. Overview
  2. Docs

Module Leaflet.LayerSource

Sourcetype _ t =
  1. | Basic : Jv.t -> [> `Basic ] t
  2. | Geojson : Jv.t -> [> `Geojson ] t
  3. | Marker : Jv.t -> [> `Marker ] t
  4. | Tile : Jv.t -> [> `Tile ] t

Basic layers

Sourceval add_to : Map.t -> _ t -> unit

add_to map layer adds layer to map

Sourceval remove : _ t -> unit

remove layer removes layer from the map it is currently active on

Sourceval remove_from : Map.t -> _ t -> unit

remove_from map layer removes layer from map

Sourceval bind_popup : Brr.El.t -> _ t -> unit

bind_popup popup layer binds popup to layer

Sourceval unbind_popup : _ t -> unit

unbind_popup layer unbinds the popup bound to layer

Sourceval open_popup : _ t -> unit

open_popup layer opens the popup bound to layer

Sourceval close_popup : _ t -> unit

close_popup layer closes the popup bound to layer

Sourceval get_popup : _ t -> Popup.t

get_popup layer is the popup bound to layer

Sourceval to_jv : _ t -> Jv.t

to_jv o is o as a Jv.t

Geojson layers

Sourceval create_geojson : ?options:Jv.t -> Jv.t -> [ `Geojson ] t

create_geojson geojson is a new geojson layer

Marker layers

Sourceval create_marker : Latlng.t -> [ `Marker ] t

create_marker latlng is a new marker with the same position as latlng

Tile layers

Sourceval create_tile_osm : string option -> [ `Tile ] t

create_tile_osm Some(url) is a new tile layer with tile server specified by url. Tile server default to openstreetmap.org. See https://wiki.openstreetmap.org/wiki/Tile_servers

OCaml

Innovation. Community. Security.