-
Notifications
You must be signed in to change notification settings - Fork 2
/
api-via-javascript-add-geojson.html
68 lines (63 loc) · 2.11 KB
/
api-via-javascript-add-geojson.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Lusc API via JavaScript</title>
<link rel="stylesheet" href="./styles/default/style.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
html {
width: 100%;
height: 100%;
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
}
body {
width: 100%;
height: 100%;
margin: 0px;
}
#map {
width: 100%;
height: 100%;
}
.olControlAttribution {
bottom: 3px!important;
background-color: #eee;
}
</style>
<script src="./OpenLayers.js"></script>
<script src="./javascripts/proj4js-compressed.js"></script>
<script src="lusc-api.js"></script>
<script src="http://luuks.github.com/API/data/hoofdsteden.js"></script>
<script>
var api = null;
function init() {
api = new Lusc.Api({});
//Beschikbare kaartlagen: alert(api.getLayers());
//Het pad naar de markertypes: alert(api.getMarkerPath());
//Beschikbare markertypes: alert(api.getMarkers());
//Pan naar een andere locatie: api.setLocation([100000,400000]);
//Zoom naar een ander zoomnivo: api.setZoomLevel(3);
//Op basis van de locatie van de client inzoomen op de kaart
//navigator.geolocation.getCurrentPosition(showLocation);
api.setLocation([183023,579910]);
api.setZoomLevel(8);
api.addGeometries(featurecollection);
}
function showLocation(position){
var lat = position.coords.latitude;
var lon = position.coords.longitude;
pointRD = api.reprojectWGS84toRD(lat,lon);
X = pointRD.lon;
Y = pointRD.lat;
//alert("X:" + parseInt(X));
//alert("Y:"+ parseInt(Y));
api.setLocation([parseInt(X),parseInt(Y)]);
}
</script>
</head>
<body onload="init();">
<div id="map"></div>
</body>
</html>