blob: 0cc79765158b6b9ab771c96c4d692f0913b350cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
type layer
external map : string -> layer = "map"
[@@bs.val] [@@bs.scope "L"]
external setView : layer -> float array -> int -> unit = "setView"
[@@bs.send]
type event
external on : layer -> string -> (event -> unit) -> unit = "on"
[@@bs.send]
type lat_lng =
{ lat : float;
lng : float;
}
external original_event : event -> Dom.mouseEvent = "originalEvent"
[@@bs.get]
external lat_lng : event -> lat_lng = "latlng"
[@@bs.get]
external target : event -> layer = "target"
[@@bs.get]
external get_lat_lng : layer -> unit -> lat_lng = "getLatLng"
[@@bs.send]
external title_layer : string -> layer = "tileLayer"
[@@bs.val] [@@bs.scope "L"]
external add_layer : layer -> layer -> unit = "addLayer"
[@@bs.send]
external clear_layers : layer -> unit = "clearLayers"
[@@bs.send]
external remove : layer -> unit = "remove"
[@@bs.send]
external get_layers : layer -> unit -> layer array = "getLayers"
[@@bs.send]
(* Fit bounds *)
external feature_group : layer array -> layer = "featureGroup"
[@@bs.val] [@@bs.scope "L"]
type bounds
external get_bounds : layer -> unit -> bounds = "getBounds"
[@@bs.send]
type fit_bounds_options =
{ padding: float array
}
external fit_bounds : layer -> bounds -> fit_bounds_options -> unit = "fitBounds"
[@@bs.send]
(* Icon *)
type icon
type div_icon_input =
{ className : string
; popupAnchor : float array
; html : Dom.element
}
external div_icon : div_icon_input -> icon = "divIcon"
[@@bs.val] [@@bs.scope "L"]
(* Marker *)
type markerInput =
{ title : string
; icon : icon
; draggable : bool
}
external marker : lat_lng -> markerInput -> layer = "marker"
[@@bs.val] [@@bs.scope "L"]
|