OpenLayers Examples
22An enterprise-grade GIS library with advanced projections and formats. All examples use MapTiler Cloud tiles.
mapMap Display & Interaction
Satellite Basemap with OpenLayersDisplay MapTiler satellite imagery as a raster tile layer in OpenLayers.
chevron_rightConfigure Interactions in OpenLayersConfigure zoom, pan, and rotation interactions on an ol.Map using OpenLayers interaction defaults.
chevron_rightInitialize an OpenLayers MapCreate an ol.Map instance with MapTiler vector tiles using ol-mapbox-style and navigation controls.
chevron_rightSwitch Vector Styles in OpenLayersDynamically switch between MapTiler vector tile styles using ol-mapbox-style in OpenLayers.
chevron_rightStatic Map Image with OpenLayersDisplay a non-interactive map image using the MapTiler Static Maps API alongside an interactive OpenLayers map.
chevron_rightpin_dropMarkers, Annotations & Overlays
Custom Marker Icons with OpenLayersStyle point features with custom icons using ol.style.Icon with SVG or PNG sources.
chevron_rightChoropleth Map with OpenLayersCreate a data-driven choropleth map using a style function to color polygons based on property values.
chevron_rightLineString Features in OpenLayersAdd a styled line to an OpenLayers map using a vector source with ol.geom.LineString geometry.
chevron_rightPolygon Features in OpenLayersRender a styled polygon area using a vector source with ol.geom.Polygon and custom fill/stroke styles.
chevron_rightAdd Markers and Popups in OpenLayersPlace point features on a vector layer and display popups with ol.Overlay on click in OpenLayers.
chevron_rightPoint Clustering with OpenLayersGroup nearby point features into clusters using ol.source.Cluster with dynamic styling based on cluster size.
chevron_rightData-Driven Styling with OpenLayersStyle vector features dynamically based on data properties using OpenLayers style functions.
chevron_rightsearchGeocoding & Search
routeRouting & Navigation
my_locationLocation & Real-Time
Geofencing with OpenLayersDefine a polygon boundary in OpenLayers and check whether a clicked point falls inside or outside the geofence.
chevron_rightGeolocation with OpenLayersTrack and display the user's current position as a point feature on an OpenLayers map using the browser Geolocation API.
chevron_rightinsightsAnalytics & Advanced
Draw Interaction in OpenLayersLet users draw points, lines, and polygons on the map using ol.interaction.Draw with a vector source.
chevron_rightExport Map as PNG with OpenLayersCapture the current OpenLayers map view as a downloadable PNG image using the canvas export API.
chevron_rightHeatmap Layer with OpenLayersVisualize point density using ol.layer.Heatmap with weighted features on a MapTiler basemap.
chevron_rightLoad GeoJSON in OpenLayersFetch and display GeoJSON features on an OpenLayers map using ol.format.GeoJSON and a styled vector layer.
chevron_rightStore Locator with OpenLayersBuild a store locator with a sidebar list, point features, and popup overlays using OpenLayers.
chevron_rightauto_awesome
Build maps using OpenLayers with AI
Install the OpenLayers skill in your IDE and let AI write the code for you.
All examples use MapTiler maps and require a free API key.