API
Leaflet.Leaflet — ModuleLeaflet
LeafletJS maps for Julia.
This package integrates with WebIO.jl to render leaflet maps for outputs like Blink.jl, Mux.jl, and for Jupyter notebooks.
All GeoInterface.jl compatible geometries can be displayed as layers.
A basic example, where we use GADM to download a country boundary shapefile, and plot them over the CARTO :dark_nolabels base layers.
using Leaflet, Blink, GADM
layers = Leaflet.Layer.([GADM.get("CHN").geom[1], GADM.get("JPN").geom[1]]; color=:orange); 
provider = Providers.CartoDB()
m = Leaflet.Map(; layers, provider, zoom=3, height=1000, center=[30.0, 120.0]);
w = Blink.Window(; body=m)
Leaflet.Layer — TypeLayer(data; kw...)Wrapper for a point/polygon layer to be passed to leaflet, holding any GeoInterface.jl compatale geometry data, and settings for displaying it in the Leaflet map.
A Layer or Vector of Layer is used for the layers keyword of Map.
Arguments
- data: An object conforming to the GeoInterface.jl interface or a- Vectorof these objects.
Keyword arguments
- color = "blue": shape color. Can use web color names or RGB strings.
- color_map = "nothing": color map.
- opacity = 0.5: alpha transparency.
- fill_opacity = 0.5: alpha transparency of fill. By default the same as- opacity.
- marker_size = 3.0: size of markers.
- border_width = 2.0: width of shape borders.
Leaflet.Map — TypeMap(; kw...)A Leaflet map object that will render as HTML/Javascript in any WebIO.jl page, or by calling WebIO.render(yourmap).
Keyword arguments