package leaflet

  1. Overview
  2. Docs
type t
val create_on : ?options:Jv.t -> string -> t

create_on id creates a map on the <div> with DOM id id. To have a functional map you will need to add a tile layer to it.

val create_from_div : ?options:Jv.t -> Brr.El.t -> t

create_from_div container creates a map given container, an instance of a <div> HTML element. To have a functional map you will need to add a tile layer to it.

val invalidate_size : t -> unit

invalidate_size map checks if the map container size changed and updates the map if so

val set_view : Latlng.t -> zoom:int option -> t -> unit

set_view latlng Some(zoom) map sets the view of the map (geographical center and zoom)

val fit_world : t -> unit

fit_world map sets a map view that mostly contains the whole world with the maximum zoom level possible

val get_container : t -> Brr.El.t

get_container map is the HTML element that contains map

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

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

val get_center : t -> Latlng.t

get_center map is the geographical center of the map view

val get_zoom : t -> int

get_zoom map is the current zoom level of the map view

val wrap_latlng : Latlng.t -> t -> Latlng.t

wrap_latlng latlng map returns a new Latlng.t where lat and lng has been wrapped according to the map's CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds. By default this means longitude is wrapped around the dateline so its value is between -180 and +180 degrees

val of_jv : Jv.t -> t

of_jv jv is jv as t

val to_jv : t -> Jv.t

to_jv o is o as Jv.t

val open_popup : Popup.t -> t -> unit
val close_popup : Popup.t option -> t -> unit
OCaml

Innovation. Community. Security.