Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active August 27, 2018 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/5e47a21c651be974cb688e8a8f967cca to your computer and use it in GitHub Desktop.
Save ThomasG77/5e47a21c651be974cb688e8a8f967cca to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Vector Style Examples</title>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.1.3/css/ol.css">
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.1.3/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
var map = new ol.Map({
view: new ol.View({center: ol.proj.transform([16.9278, 52.4044], 'EPSG:4326', 'EPSG:3857'), zoom: 11}),
layers: [new ol.layer.Tile({
source: new ol.source.OSM()
})],
target:'map'
});
var marker = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([16.9071388, 52.4901917], 'EPSG:4326', 'EPSG:3857')),
});
var markers = new ol.source.Vector({
features: [marker]
});
var markerVectorLayer = new ol.layer.Vector({
source: markers,
});
map.addLayer(markerVectorLayer);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment