Skip to content

Instantly share code, notes, and snippets.

@simon04
Created April 20, 2014 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simon04/11109048 to your computer and use it in GitHub Desktop.
Save simon04/11109048 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" href="http://josm.openstreetmap.de/mapsviewdata/ol.css" type="text/css">
<link rel="stylesheet" href="http://josm.openstreetmap.de/mapsview.css" type="text/css">
<script src="http://josm.openstreetmap.de/mapsviewdata/ol.js" type="text/javascript"></script>
<title>Geoimage.at MaxRes - JOSM - Imagery Preview</title>
</head>
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
function parseURL(url) {
// Let the browser do the work
var parser = document.createElement('a');
parser.href = url;
// Convert query string to object
var queries = parser.search.replace(/^\?/, '').split('&');
var searchObject = {};
for (var i = 0; i < queries.length; i++) {
var split = queries[i].split('=');
searchObject[split[0].toUpperCase()] = split[1];
}
return {
protocol: parser.protocol,
host: parser.host,
hostname: parser.hostname,
port: parser.port,
pathname: parser.pathname,
search: parser.search,
searchObject: searchObject,
hash: parser.hash
};
}
var wmsURL = parseURL('http://gis.lebensministerium.at/wmsgw/?key=4d80de696cd562a63ce463a58a61488d&FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=Luftbild_MR,Luftbild_1m,Luftbild_8m,Satellitenbild_30m&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}');
var wmsSource = new ol.source.TileWMS(({
url: wmsURL.protocol + '//' + wmsURL.host + wmsURL.pathname,
params: {
KEY: wmsURL.searchObject.KEY,
LAYERS: wmsURL.searchObject.LAYERS,
MAP: wmsURL.searchObject.MAP,
STYLES: wmsURL.searchObject.STYLES,
TRANSPARENT: wmsURL.searchObject.TRANSPARENT,
VERSION: wmsURL.searchObject.VERSION
}
}));
function t(la, lo) {
return ol.proj.transform([lo, la], 'EPSG:4326', 'EPSG:3857')
}
var map = new ol.Map({
target: 'map',
ol3Logo: false,
renderer: 'canvas',
layers: [new ol.layer.Tile({
source: wmsSource
}), new ol.layer.Vector({
source: new ol.source.Vector({
features: [new ol.Feature({
'geometry': new ol.geom.LineString([t(46.3785275, 9.5406306), t(49.0126611, 9.5406306), t(49.0126611, 17.1739737), t(46.3785275, 17.1739737), t(46.3785275, 9.5406306)])
})]
}),
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
width: 2
})
})
}), new ol.layer.Vector({
source: new ol.source.Vector({
features: [new ol.Feature({
'geometry': new ol.geom.LineString([t(46.9929304, 16.5073284), t(46.9929304, 16.2834170), t(46.8713046, 16.1358390), t(46.8190947, 15.9831722), t(46.6551750, 16.0493278), t(46.7180116, 15.8610387), t(46.6900933, 15.7592608), t(46.6796202, 15.5607938), t(46.6342132, 15.5760605), t(46.6027553, 15.4793715), t(46.6516819, 15.4335715), t(46.6342132, 15.2249267), t(46.6481886, 15.0468154), t(46.5887681, 14.9908376), t(46.6237293, 14.9603042), t(46.6027553, 14.8534374), t(46.5012666, 14.8330818), t(46.4977636, 14.7516595), t(46.4381781, 14.6804149), t(46.4381781, 14.6142593), t(46.3785275, 14.5786370), t(46.4311638, 14.4412369), t(46.4276563, 14.1613476), t(46.4767409, 14.1257253), t(46.4767409, 14.0188585), t(46.5257813, 13.9119917), t(46.5047694, 13.8254805), t(46.5607830, 13.4438134), t(46.5502848, 13.3064132), t(46.5887681, 13.1283019), t(46.6132433, 12.8433237), t(46.6412014, 12.7262791), t(46.6656529, 12.5125455), t(46.7040543, 12.3598787), t(46.7703197, 12.3649676), t(46.7772902, 12.2886341), t(46.8852187, 12.2733674), t(46.8747835, 12.2072118), t(46.9026062, 12.1308784), t(46.9998721, 12.1156117), t(47.0657733, 12.2530119), t(47.0934969, 12.2123007), t(47.0449712, 11.9833004), t(46.9616816, 11.7339445), t(47.0102830, 11.6321666), t(46.9755722, 11.5405665), t(47.0068129, 11.4998553), t(46.9651546, 11.4184330), t(46.9755722, 11.2555884), t(46.9130360, 11.1130993), t(46.7633482, 11.0418548), t(46.7598621, 10.8891879), t(46.7842599, 10.7416099), t(46.8643462, 10.7059877), t(46.8399847, 10.5787653), t(46.8504267, 10.4566318), t(46.9269392, 10.4769874), t(46.9894592, 10.3853873), t(46.8643462, 10.2327204), t(46.8330223, 10.1207647), t(46.9408389, 9.8663199), t(47.0033426, 9.9019422), t(47.0588402, 9.6831197), t(47.0380354, 9.6118752), t(47.1281310, 9.6322307), t(47.1662025, 9.5813418), t(47.2664422, 9.5406306), t(47.3492559, 9.6067863), t(47.3699390, 9.6729419), t(47.4457079, 9.6424085), t(47.4801122, 9.5660751), t(47.5282405, 9.7136531), t(47.5969187, 9.7848976), t(47.5454185, 9.8357866), t(47.5385480, 9.9477423), t(47.4491493, 10.0902313), t(47.3664924, 10.1105869), t(47.3871688, 10.2428982), t(47.2698953, 10.1869203), t(47.2975125, 10.3243205), t(47.4491493, 10.4820763), t(47.4869904, 10.4311873), t(47.5900549, 10.4413651), t(47.5522881, 10.4871652), t(47.5351124, 10.5482319), t(47.5660246, 10.5991209), t(47.5316766, 10.7568766), t(47.5454185, 10.8891879), t(47.4869904, 10.9400769), t(47.3906141, 10.9960547), t(47.4422662, 11.2352328), t(47.3975039, 11.2810328), t(47.5144941, 11.4235219), t(47.5076195, 11.5761888), t(47.5900549, 11.6067221), t(47.5866227, 11.8357224), t(47.6243647, 12.0036560), t(47.6037815, 12.2072118), t(47.6963421, 12.1614117), t(47.7442718, 12.2581008), t(47.6792136, 12.2530119), t(47.7100408, 12.4311232), t(47.6312240, 12.4921899), t(47.6277944, 12.5685234), t(47.6894913, 12.6295901), t(47.6689338, 12.7720792), t(47.5419833, 12.8331459), t(47.4732332, 12.9756350), t(47.4938677, 13.0417906), t(47.5557226, 13.0367017), t(47.6415112, 13.0977685), t(47.7100408, 13.0316128), t(47.7203125, 12.9043905), t(47.8468300, 13.0061684), t(47.9355501, 12.9451016), t(47.9594103, 12.8636793), t(48.0036929, 12.8636793), t(48.0989418, 12.7517236), t(48.2109733, 12.8738571), t(48.2109733, 12.9603683), t(48.2652035, 13.0417906), t(48.2990682, 13.1842797), t(48.2922971, 13.2606131), t(48.3565867, 13.3980133), t(48.4174180, 13.4438134), t(48.5523383, 13.4387245), t(48.5860123, 13.5099690), t(48.5725454, 13.6117469), t(48.5118999, 13.7287915), t(48.5725454, 13.7847694), t(48.6263915, 13.8203916), t(48.7171267, 13.7949471), t(48.7741724, 13.8509250), t(48.6633774, 14.0595697), t(48.6331182, 14.0137696), t(48.5927444, 14.0748364), t(48.5961101, 14.2173255), t(48.5489696, 14.3649034), t(48.6499311, 14.4666813), t(48.5961101, 14.5582815), t(48.6263915, 14.5989926), t(48.5759124, 14.7211261), t(48.6868997, 14.7211261), t(48.7271983, 14.8229040), t(48.7775260, 14.8178151), t(48.7851754, 14.9647227), t(49.0126611, 14.9893637), t(48.9950306, 15.1485933), t(48.9315502, 15.1943934), t(48.9850128, 15.3063491), t(48.9850128, 15.3928603), t(48.9282069, 15.4844604), t(48.8545973, 15.7490830), t(48.8880697, 15.8406831), t(48.7808794, 16.0086166), t(48.7339115, 16.2070835), t(48.7372678, 16.3953727), t(48.8110498, 16.4920617), t(48.7741724, 16.6905286), t(48.7339115, 16.7057953), t(48.7137690, 16.8991733), t(48.5152710, 16.9755067), t(48.4511817, 16.8482844), t(48.3464411, 16.8533733), t(48.2516513, 16.9551512), t(48.1498955, 16.9907734), t(48.1397088, 17.0925513), t(48.0241182, 17.0823736), t(48.0207146, 17.1739737), t(47.8741447, 17.0823736), t(47.8673174, 16.9856845), t(47.8092489, 17.0823736), t(47.7031919, 17.0925513), t(47.6792136, 16.7414176), t(47.7511153, 16.7057953), t(47.7545368, 16.5378617), t(47.7066164, 16.5480395), t(47.6689338, 16.4208172), t(47.6175045, 16.5734840), t(47.6312240, 16.6701730), t(47.5385480, 16.7108842), t(47.4491493, 16.6599952), t(47.3940591, 16.5429506), t(47.3940591, 16.4615283), t(47.2768010, 16.4920617), t(47.1973317, 16.4259060), t(47.1489007, 16.4717061), t(47.1489007, 16.5480395), t(47.0796369, 16.4767950), t(47.0588402, 16.5276840)])
})]
}),
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'red',
width: 2
})
})
})],
view: new ol.View2D({
center: t(47.70, 13.36),
zoom: 5,
maxZoom: 19
})
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment