[mapserver-users] asking help about using openlayer in mapserver
Boubacar Bah
bahbouba.909 at gmail.com
Mon Sep 27 13:01:38 PDT 2021
hello every body ; recently i try to display a map with openlayers in
mapserver
l created a html file in witch i put a openlayer javascript this is the
code below:
<!DOCTYPE html>
<html>
<head>
<title>Premiere carte</title>
<link rel="stylesheet" href="
https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
});
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: '
https://openlayers.org/en/v4.6.4/examples/data/geojson/countries.geojson',
format: new ol.format.GeoJSON(),
})
});
var map= new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
</script>
</body>
</html>
I put this file in the htdocs folder in apache and i try to execute this
file in my browser but the browser send a blank page.
now l want to know why the script not work and how l can fix it
thank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210927/e1ee9fde/attachment.htm>
More information about the MapServer-users
mailing list