我想从Google Map迁移到Openlayer Map v5。我需要一些帮助来修改地图的颜色或对象,例如:道路,地形,水。
基本代码:
<script>
var map = new ol.Map({
view: new ol.View({center: ol.proj.transform([13.12754,45.68177], 'EPSG:4326', 'EPSG:3857'), zoom:12}),
layers: [new ol.layer.Tile({
source: new ol.source.OSM()
})],
target:'map'
});
var markers = new ol.layer.Vector({
source: new ol.source.Vector(),
style: new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 1],
src: 'images/marker.png'
})
})
});
map.addLayer(markers);
var marker = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat([13.12754,45.68177])));
markers.getSource().addFeature(marker);
</script>