js stuff
This commit is contained in:
parent
a1e74bd190
commit
5f8887e8b6
@ -13,6 +13,8 @@
|
||||
|
||||
<script src="js/lib/leaflet.js"></script>
|
||||
<script src="js/lib/mithril.min.js"></script>
|
||||
<script src="js/api.js"></script>
|
||||
<script src="js/LayerManager.js"></script>
|
||||
<script src="js/WebSocketChannel.js"></script>
|
||||
<script src="js/RealtimeTileLayer.js"></script>
|
||||
<script src="js/CoordinatesDisplay.js"></script>
|
||||
|
11
server/static/js/LayerManager.js
Normal file
11
server/static/js/LayerManager.js
Normal file
@ -0,0 +1,11 @@
|
||||
var LayerManager = (function(){
|
||||
|
||||
|
||||
|
||||
return {
|
||||
init: function(layers){
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
16
server/static/js/api.js
Normal file
16
server/static/js/api.js
Normal file
@ -0,0 +1,16 @@
|
||||
var api = {
|
||||
|
||||
getMapObjects: function(x1,y1,z1,x2,y2,z2,type){
|
||||
return m.request("/api/mapobjects/" +
|
||||
x1 + "/" + y1 + "/" + z1 + "/" +
|
||||
x2 + "/" + y2 + "/" + z2 + "/" +
|
||||
type
|
||||
);
|
||||
},
|
||||
|
||||
getConfig: function(){
|
||||
return m.request("/api/config");
|
||||
}
|
||||
|
||||
|
||||
};
|
@ -2,6 +2,11 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
api.getConfig().then(function(cfg){
|
||||
LayerManager.init(cfg.layers);
|
||||
|
||||
});
|
||||
|
||||
var crs = L.Util.extend({}, L.CRS.Simple, {
|
||||
//transformation: L.transformation(0.001, 0, -0.001, 0),
|
||||
scale: function (zoom) {
|
||||
|
@ -11,7 +11,16 @@ var TravelnetOverlay = (function(){
|
||||
|
||||
return L.LayerGroup.extend({
|
||||
onAdd: function(map) {
|
||||
console.log("TravelnetOverlay.onAdd");
|
||||
console.log("TravelnetOverlay.onAdd", map);
|
||||
|
||||
map.on('baselayerchange', function (e) {
|
||||
console.log("baselayerchange", e.layer);
|
||||
});
|
||||
|
||||
api.getMapObjects(-10,-10,-10,10,10,10,"travelnet")
|
||||
.then(function(list){
|
||||
console.log(list);
|
||||
})
|
||||
},
|
||||
|
||||
onRemove: function(map) {
|
||||
|
Loading…
Reference in New Issue
Block a user