2022-04-12 13:46:37 +02:00
|
|
|
(* BSD-2-Clause License *)
|
|
|
|
|
|
2022-04-09 22:21:22 +02:00
|
|
|
type _ t =
|
|
|
|
|
| Basic : Jv.t -> [> `Basic ] t
|
|
|
|
|
| Geojson : Jv.t -> [> `Geojson ] t
|
|
|
|
|
| Marker : Jv.t -> [> `Marker ] t
|
|
|
|
|
| Tile : Jv.t -> [> `Tile ] t
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-04-09 22:21:22 +02:00
|
|
|
(** Basic layers *)
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [add_to map layer] adds [layer] to [map] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val add_to : Map.t -> _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [remove layer] removes [layer] from the map it is currently active on *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val remove : _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [remove_from map layer] removes [layer] from [map] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val remove_from : Map.t -> _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [bind_popup popup layer] binds [popup] to [layer] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val bind_popup : Brr.El.t -> _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [unbind_popup layer] unbinds the popup bound to [layer] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val unbind_popup : _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [open_popup layer] opens the popup bound to [layer] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val open_popup : _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [close_popup layer] closes the popup bound to [layer] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val close_popup : _ t -> unit
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [get_popup layer] is the popup bound to [layer] *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val get_popup : _ t -> Popup.t
|
2022-04-08 13:21:20 +02:00
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [to_jv o] is [o] as a {!Jv.t} *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val to_jv : _ t -> Jv.t
|
|
|
|
|
|
|
|
|
|
(** Geojson layers *)
|
|
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [create_geojson geojson] is a new geojson layer *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val create_geojson : ?options:Jv.t -> Jv.t -> [ `Geojson ] t
|
|
|
|
|
|
|
|
|
|
(** Marker layers *)
|
|
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [create_marker latlng] is a new marker with the same position as latlng *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val create_marker : Latlng.t -> [ `Marker ] t
|
|
|
|
|
|
|
|
|
|
(** Tile layers *)
|
|
|
|
|
|
2022-05-19 22:42:28 +02:00
|
|
|
(** [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} *)
|
2022-04-09 22:21:22 +02:00
|
|
|
val create_tile_osm : string option -> [ `Tile ] t
|