Last active
August 29, 2015 14:25
-
-
Save pgiraud/516ab11d90b875be0aa3 to your computer and use it in GitHub Desktop.
OpenLayers WMS - Points not showing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Tiled WMS example</title> | |
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.css" type="text/css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js"></script> | |
<style> | |
#map, #map2 { | |
width: 512px; | |
height: 256px; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>No gutter</h2> | |
<div id="map" class="map"></div> | |
<h2>Gutter</h2> | |
<div id="map2" class="map"></div> | |
</body> | |
<script src="index.js"></script> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var layers = [ | |
new ol.layer.Tile({ | |
source: new ol.source.MapQuest({layer: 'sat'}) | |
}), | |
new ol.layer.Tile({ | |
source: new ol.source.TileWMS({ | |
url: 'http://visi-sextant.ifremer.fr/cgi-bin/sextant/wms/wms_bgmb', | |
params: {'LAYERS': 'SISMER_mesures'}, | |
serverType: 'geoserver' | |
}) | |
}) | |
]; | |
var map = new ol.Map({ | |
layers: layers, | |
target: 'map', | |
view: new ol.View({ | |
center: [0, 0], | |
zoom: 4 | |
}) | |
}); | |
layers = [ | |
new ol.layer.Tile({ | |
source: new ol.source.MapQuest({layer: 'sat'}) | |
}), | |
new ol.layer.Tile({ | |
source: new ol.source.TileWMS({ | |
url: 'http://visi-sextant.ifremer.fr/cgi-bin/sextant/wms/wms_bgmb', | |
params: {'LAYERS': 'SISMER_mesures'}, | |
serverType: 'geoserver', | |
gutter: 15 | |
}) | |
}) | |
]; | |
var map2 = new ol.Map({ | |
layers: layers, | |
target: 'map2', | |
view: new ol.View({ | |
center: [0, 0], | |
zoom: 4 | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment