package leaflet

  1. Overview
  2. Docs
type _ 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
  5. | Vector : Jv.t -> [> `Vector ] t
type _ sub =
  1. | Basic : [> `Basic ] sub
  2. | Geojson : [> `Geojson ] sub
  3. | Marker : [> `Marker ] sub
  4. | Tile : [> `Tile ] sub
  5. | Vector : [> `Vector ] sub

Basic layers

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

add_to map layer adds layer to map

val remove : _ t -> unit

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

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

remove_from map layer removes layer from map

val bind_popup : Popup.t -> _ t -> unit

bind_popup popup layer binds popup to layer

val unbind_popup : _ t -> unit

unbind_popup layer unbinds the popup bound to layer

val open_popup : _ t -> unit

open_popup layer opens the popup bound to layer

val close_popup : _ t -> unit

close_popup layer closes the popup bound to layer

val get_popup : _ t -> Popup.t

get_popup layer is the popup bound to layer

val to_jv : _ t -> Jv.t

to_jv o is o as a Jv.t

val of_jv : 'a sub -> Jv.t -> 'a t

of_jv tag o is o as a tag t

val on : 'a Event.sub -> ('a Event.t -> 'b) -> 'c t -> unit

on event handler layer add an event listener on layer for event event with handler handler

Geojson layers

type geojson_opt =
  1. | Point_to_layer of Jv.t -> Latlng.t -> [ `Marker ] t
  2. | Style of Jv.t -> unit
  3. | On_each_feature of Jv.t -> [ `Geojson ] t -> unit
  4. | Filter of Jv.t -> bool
  5. | Coords_to_latlng of Jv.t -> Latlng.t
  6. | Markers_inherit_options of bool

type for geojson option, used to create geojson

val create_geojson : Brr.Json.t -> geojson_opt array -> [ `Geojson ] t

create_geojson geojson is a new geojson layer

Tile layers

type tile_layer_opt =
  1. | Min_zoom of int
  2. | Max_zoom of int
  3. | Subdomains of string array
  4. | Error_tile_url of string
  5. | Zoom_offset of int
  6. | Tms of bool
  7. | Zoom_reverse of bool
  8. | Detect_retina of bool
  9. | Cross_origin of bool
  10. | Referrer_policy of bool
  11. | Tile_size of Point.t
  12. | Opacity of float
  13. | Update_when_idle of bool
  14. | Update_when_zooming of bool
  15. | Update_interval of int
  16. | Z_index of int
  17. | Bounds of Latlng.t * Latlng.t
  18. | Max_native_zoom of int
  19. | Min_native_zoom of int
  20. | No_wrap of bool
  21. | Pane of string
  22. | Class_name of string
  23. | Keep_buffer of int
val create_tile : string -> attribution:string -> tile_layer_opt array -> [ `Tile ] t

create_tile url attribution opts create a new tile layer

val create_tile_osm : tile_layer_opt array -> [ `Tile ] t

create_tile_osm opts create a new tile layer with tile server and attribution set to openstreetmap.org. See https://wiki.openstreetmap.org/wiki/Tile_servers

val create_polyline : Latlng.t array -> [ `Vector ] t

create_polyline l create a polyline layer from l

val create_circle_marker : Latlng.t -> float -> [ `Vector ] t

create_circle_marker c r create a cirecle marker layer with center c and radius r

OCaml

Innovation. Community. Security.