Skip to content
Permalink
d66ccb417c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
76 lines (71 sloc) 3.99 KB
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fopenlayers%2Fopenlayers.github.io%40master%2Fen%2Fv6.1.1%2Fcss%2Fol.css&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715852602&amp;sdata=VaQE95efn4WZmdx0KP5vdbNCeSm0ieVSPpux0W0e1bU%3D&amp;reserved=0" type="text/css">
<style>
.map {
height: 480px;
width: 100%;
}
</style>
<script src="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fopenlayers%2Fopenlayers.github.io%40master%2Fen%2Fv6.1.1%2Fbuild%2Fol.js&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715852602&amp;sdata=4GQSFqe5bHe7tXx1PTFLDxEQdGZ%2FKotGCWVnA9dDx2I%3D&amp;reserved=0"></script>
<title>OpenLayers example</title>
</head>
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.fromLonLat([-1.499918, 52.405320]),
zoom: 13
})
});
var marker1 = new ol.layer.Vector({
source: new ol.source.Vector({
features: [
new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-1.499918, 52.405320]))
})
]
}),
style: new ol.style.Style({
image: new ol.style.Icon({
//anchor: [0.5, 0.5],
//anchorXUnits: "fraction",
//anchorYUnits: "fraction",
scale: 0.04,
src:"https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fimage.flaticon.com%2Ficons%2Fsvg%2F1397%2F1397898.svg&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715862594&amp;sdata=2MZQkK3qOrN9pcaurvZ%2F7Cqf8c2%2FOdMb0OZrjzrGv5U%3D&amp;reserved=0",
//src: "https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fe%2Fec%2FRedDot.svg&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715862594&amp;sdata=Qx5LJWCdmQ8F8xGQm769PhCwrSvPHiP5ZJaIJUAWntU%3D&amp;reserved=0"
})
})
});
var layer2 = new ol.layer.Vector({
source: new ol.source.Vector({
features: [
new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-1.4743109, 52.4069807])),
})
]
}),
style: new ol.style.Style({
image: new ol.style.Icon({
//anchor: [0.5, 0.5],
//anchorXUnits: "fraction",
//anchorYUnits: "fraction",
scale: 0.04,
src:"https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fimage.flaticon.com%2Ficons%2Fsvg%2F1397%2F1397898.svg&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715862594&amp;sdata=2MZQkK3qOrN9pcaurvZ%2F7Cqf8c2%2FOdMb0OZrjzrGv5U%3D&amp;reserved=0",
//src: "https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fe%2Fec%2FRedDot.svg&amp;data=02%7C01%7Comaram%40uni.coventry.ac.uk%7C5c447ecb1c5e4eadcd4508d7aafc062c%7C4b18ab9a37654abeac7c0e0d398afd4f%7C0%7C0%7C637165871715862594&amp;sdata=Qx5LJWCdmQ8F8xGQm769PhCwrSvPHiP5ZJaIJUAWntU%3D&amp;reserved=0"
})
})
});
map.addLayer(layer1);
map.addLayer(layer2);
</script>
</body>
</html>