API Reference
Main Functions
explore
explore(; extent, provider, figure)
explore(geometry; padding=0.1, kw...)Launch the GeoExplorer application.
Keyword Arguments:
extent: Initial map extent (default: Continental US)provider: Tile provider for basemap (default: OpenStreetMap)figure: Makie Figure to use (default: creates new 1200x800 figure)
With Geometry:
geometry: Any GeoInterface-compatible geometrypadding: Fractional padding around geometry extent (default: 0.1)
Returns: GeoExplorerApp instance
Examples:
# Default view
app = explore()
# Custom extent
app = explore(extent=Extents.Extent(X=(-74.1, -73.9), Y=(40.7, 40.8)))
# With tile provider
app = explore(provider=TileProviders.Esri(:WorldImagery))
# With geometry
geom = GeoJSON.read("data.geojson")
app = explore(geom)plot_geometry!
plot_geometry!(app::GeoExplorerApp, geometry; kw...)Plot a GeoInterface-compatible geometry on the map.
Arguments:
app: The GeoExplorerApp instancegeometry: Any GeoInterface-compatible geometry
Keyword Arguments (vary by geometry type):
| Geometry | Keywords |
|---|---|
| Point/MultiPoint | color=:red, markersize=10 |
| LineString/MultiLineString | color=:blue, linewidth=2 |
| Polygon/MultiPolygon | color=(:blue, 0.3), strokecolor=:blue, strokewidth=2 |
Examples:
app = explore()
# Plot with defaults
plot_geometry!(app, geom)
# Customize appearance
plot_geometry!(app, polygon, color=(:green, 0.5), strokecolor=:darkgreen)
plot_geometry!(app, line, color=:red, linewidth=3)
plot_geometry!(app, points, color=:orange, markersize=15)Tile Providers
available_providers
available_providers()Returns a list of available tile providers as name => provider pairs.
Available Providers:
- OpenStreetMap
- Esri WorldImagery
- Esri WorldTopoMap
- Esri WorldStreetMap
- CartoDB Positron
- CartoDB DarkMatter
Example:
providers = available_providers()
app = explore(provider=providers[2].second) # Esri WorldImageryset_provider!
set_provider!(app::GeoExplorerApp, provider)Note: Changing tile provider at runtime is not currently supported by Tyler.jl. Use explore(provider=...) to specify the provider at creation time.
Layer Functions
add_layer!
add_layer!(app::GeoExplorerApp, name::String, plot; visible=true)Add a plot as a named layer.
Arguments:
app: The GeoExplorerApp instancename: Display name for the layerplot: A Makie plot object (fromscatter!,lines!,poly!, etc.)visible: Initial visibility (default: true)
Returns: Layer instance
Example:
plt = scatter!(app.map_axis, xs, ys; color=:red)
add_layer!(app, "My Points", plt)remove_layer!
remove_layer!(app::GeoExplorerApp, layer::Layer)
remove_layer!(app::GeoExplorerApp, name::String)Remove a layer from the application.
toggle_layer!
toggle_layer!(layer::Layer)
toggle_layer!(app::GeoExplorerApp, name::String)Toggle the visibility of a layer.
get_layer
get_layer(app::GeoExplorerApp, name::String)Get a layer by name. Returns nothing if not found.
zoom_to_layer!
zoom_to_layer!(app::GeoExplorerApp, layer::Layer; padding=0.1)
zoom_to_layer!(app::GeoExplorerApp, name::String; padding=0.1)Zoom the map to fit the extent of a layer.
Arguments:
padding: Fractional padding around the layer extent (default: 0.1)
Types
GeoExplorerApp
Main application struct containing:
figure::Figure- The GLMakie figuremap_axis::Axis- The map axismap::Tyler.Map- The Tyler map objectzoom_level::Observable{Int}- Current zoom levelprovider- Current tile providerextent::Extents.Extent- Original extentcursor_pos::Observable{Tuple{Float64, Float64}}- Cursor position (lon, lat)layers::Vector{Layer}- Registered layers
Layer
A layer that can be plotted on top of the base map.
name::String- Display name for the layerplot::Any- Reference to the Makie plot objectvisible::Observable{Bool}- Whether the layer is currently visible
Coordinate Conversion
GeoExplorer uses Web Mercator (EPSG:3857) internally but accepts WGS84 (EPSG:4326) coordinates for navigation functions.
The cursor position display shows WGS84 coordinates (latitude/longitude in degrees).