Last active
September 8, 2016 15:17
-
-
Save kdekooter/8c1abd3a8ceb1a0fd668af23c7d5fde4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js"></script> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-3.0.0.min.js"></script> | |
<script type="text/javascript"> | |
var firstProjection = 'WGS84'; | |
// See http://www.spatialreference.org/ref/epsg/28992/proj4/ | |
var secondProjection = '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs'; | |
var latLon = [51.930084, 4.546079]; | |
var coordinates = proj4(firstProjection, secondProjection, latLon); | |
var url = 'http://geodata.nationaalgeoregister.nl/kadastralekaartv2/wms?' + | |
'LAYERS=kadastralekaart&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A28992' + | |
'&BBOX=' + (coordinates[0] - 50) + ',' + (coordinates[1] - 50) + ',' + (coordinates[0] + 50) + ',' + (coordinates[1] + 50) + | |
'&WIDTH=1975&HEIGHT=1239' | |
console.log(url); | |
$('#map').attr('src', url); | |
</script> | |
</head> | |
<body> | |
<img id="map"/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment