74 linhas
2.1 KiB
HTML
Arquivo Executável
74 linhas
2.1 KiB
HTML
Arquivo Executável
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css">
|
|
<style>
|
|
.map {
|
|
height: 400px;
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js" type="text/javascript"></script>
|
|
<script src="http://epsg.io/21781-1753.js" type="text/javascript"></script>
|
|
|
|
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
|
|
<title>OpenLayers example</title>
|
|
</head>
|
|
<body>
|
|
<h2>My Map</h2>
|
|
<div id="map" class="map"></div>
|
|
<script type="text/javascript">
|
|
var style = (function() {
|
|
var stroke = new ol.style.Stroke({
|
|
//color: '#666'
|
|
});
|
|
var textStroke = new ol.style.Stroke({
|
|
//color: '#fff',
|
|
width: 3
|
|
});
|
|
var textFill = new ol.style.Fill({
|
|
// color: '#000'
|
|
});
|
|
|
|
return function(feature, resolution) {
|
|
return [new ol.style.Style({
|
|
stroke: stroke,
|
|
text: new ol.style.Text({
|
|
font: '12px Calibri,sans-serif',
|
|
text: feature.get('key'),
|
|
fill: textFill,
|
|
stroke: textStroke
|
|
})
|
|
})];
|
|
};
|
|
})();
|
|
var map = new ol.Map({
|
|
target: 'map',
|
|
layers: [
|
|
new ol.layer.Tile({
|
|
source: new ol.source.OSM()
|
|
//map = new map.addLayer(Openlayers.Layer.OSM('beltrao.tif'));
|
|
// map.addLayer(Openlayers.Layer.OSM('beltrao.tif'));
|
|
}),
|
|
new ol.layer.Vector({
|
|
title: 'Buildings',
|
|
source: new ol.source.Vector({
|
|
url: 'mapas/ttt.kml',
|
|
format: new ol.format.KML({
|
|
extractStyles: false
|
|
})
|
|
}),
|
|
style: style
|
|
}),
|
|
],
|
|
view: new ol.View({
|
|
center: ol.proj.fromLonLat([-53.0524, -26.0759]),
|
|
zoom: 10.7
|
|
})
|
|
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|