OpenLayers ist das schwerste, aber auch feature-reichste Map-Framework. Bietet alles out-of-the-box.
8 Layer via Select-Menü umschaltbar: OSM, CartoDB (Light/Dark), OpenTopoMap, Esri (Satellite/Street), Wikimedia, Stamen Terrain.
Ja, via OSRM-API. OpenLayers selbst hat keine Routing-Engine, aber die OSRM-Response kann als LineString-Layer dargestellt werden.
fetch('https://router.project-osrm.org/route/v1/driving/13.4,52.5;11.6,48.1?geometries=geojson')
.then(r => r.json()).then(d => {
const route = new ol.format.GeoJSON().readFeature(d.routes[0].geometry);
new ol.layer.Vector({ source: new ol.source.Vector({ features: [route] }), style: new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'blue', width: 4 }) }) });
});
Über ol.style.Style mit ol.style.Icon für Bilder oder ol.style.Text für Text.
Built-in! ol/interaction/Draw und ol/interaction/Modify – kein Plugin nötig.
map.addInteraction(new ol.interaction.Draw({ source: vectorSource, type: 'Polygon' }));
Native Unterstützung für WMS-, WMTS-, XYZ- und TileJSON-Quellen. Ideal für GIS-Integration.
Built-in via ol/source/Cluster.
Unterstützt alle EPSG-Codes (z.B. EPSG:3857, EPSG:4326, EPSG:25832). Leaflet und MapLibre können nur Web Mercator.
Ja, via ol/layer/Heatmap.
~400 KB gzip (ol). Kann per Tree-Shaking reduziert werden.
BSD-2-Clause – frei für kommerzielle Projekte.
Mehr erfahren: openlayers.org