gwt: add vtm-web-js project

This commit is contained in:
Hannes Janetzek
2014-03-22 03:23:19 +01:00
parent e6eab7f773
commit c7508d330d
16 changed files with 885 additions and 0 deletions

102
vtm-web-js/war/default.css Normal file
View File

@@ -0,0 +1,102 @@
.header {
background-color: #ddd;
text-align: center;
}
html,body {
height: 100%;
width: 100%;
margin: 0 0 0 0;
font-family: Arial, "MS Trebuchet", sans-serif;
}
#credits {
position: absolute;
bottom: 0.2em;
right: 0.2em;
z-index: 20000;
color: white;
background-color: #000;
opacity: 0.5;
padding: 0.2em 0.5em 0.2em 0.5em;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
font-size: 11px;
}
#credits a {
color: white;
text-decoration: none;
font-variant: small-caps;
}
#search {
z-index: 20000;
position: absolute;
top: 0.5em;
left: 0.5em;
background-color: rgba(0, 0, 0, 0.8);
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
visibility: hidden;
}
#listContainer {
color: #FFFFFF;
}
#nameFieldContainer,.gwt-TextBox {
width: 250px;
}
/* Turn on a 16x16 scrollbar */
::-webkit-scrollbar {
width: 10px;
height: 0px;
}
/* Turn on single button up on top, and down on bottom */
::-webkit-scrollbar-button:start:decrement,::-webkit-scrollbar-button:end:increment
{
display: block;
}
/* Turn off the down area up on top, and up area on bottom */
::-webkit-scrollbar-button:vertical:start:increment,::-webkit-scrollbar-button:vertical:end:decrement
{
display: none;
}
/* Place The scroll down button at the bottom */
::-webkit-scrollbar-button:end:increment {
/*background-image: url(images/scroll_cntrl_dwn.png);*/
}
/* Place The scroll up button at the up */
::-webkit-scrollbar-button:start:decrement {
/*background-image: url(images/scroll_cntrl_up.png);*/
}
/* Top area above thumb and below up button */
::-webkit-scrollbar-track-piece:vertical:start {
/*background-image: url(images/scroll_gutter_top.png), url(images/scroll_gutter_mid.png);
background-repeat: no-repeat, repeat-y;*/
}
/* Bottom area below thumb and down button */
::-webkit-scrollbar-track-piece:vertical:end {
/*background-image: url(images/scroll_gutter_btm.png), url(images/scroll_gutter_mid.png);
background-repeat: no-repeat, repeat-y;
background-position: bottom left, 0 0;*/
}
/* The thumb itself */
::-webkit-scrollbar-thumb:vertical {
height: 56px;
width: 12px;
/* -webkit-border-image: url(images/scroll_thumb.png) 8 0 8 0 stretch stretch;*/
background-color: #DDDDDD;
opacity: 0.5;
}

33
vtm-web-js/war/index.html Normal file
View File

@@ -0,0 +1,33 @@
<!doctype html>
<html>
<head>
<title>vtm-web-js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="default.css">
</head>
<body oncontextmenu="return false;">
<div id="canvas-area"
style="position: fixed; left: 0px; top: 0px; width: 100%; height: 100%;">
<canvas id="map-canvas">
Your browser does not support the HTML5 canvas tag.
</canvas>
</div>
<script type="text/javascript" src="map.js"></script>
<script type="text/javascript" src="VtmWebApp/js/_tessellate.js"></script>
<script type="text/javascript" src="VtmWebApp/js/tessellate.js"></script>
<script type="text/javascript" src="VtmWebApp/VtmWebApp.nocache.js"></script>
<div id="credits">
<a href="https://github.com/hjanetzek/vtm">Source</a> | map data © <a
href="http://www.openstreemap.org">OpenStreetMap</a> contributors | <a
href="http://www.opensciencemap.org">OpenScienceMap</a>
</div>
</body>
</html>

42
vtm-web-js/war/map.js Normal file
View File

@@ -0,0 +1,42 @@
var mapconfig = {
zoom : 12,
latitude : 53.075,
longitude : 8.8080,
tileSize : 400
}
function createLayers() {
var m = map.map();
// var t = map.loadTheme("DEFAULT");
// var ts = new vtm.OSciMap4TileSource();
// var l = new vtm.OsmTileLayer(m);
// l.setTileSource(ts)
// l.setRenderTheme(t)
var s = new vtm.BitmapTileSource("http://a.tile.stamen.com/toner", 0, 18);
var l = new vtm.BitmapTileLayer(m, s);
map.addLayer(l)
// map.addLayer(new vtm.BuildingLayer(m, l))
// map.addLayer(new vtm.LabelLayer(m, l))
// t = map.loadTheme("TRONRENDER")
// ts = new vtm.OsmLanduseJsonTileSource()
// l = new vtm.VectorTileLayer(m, ts)
// l.setRenderTheme(t)
// map.addLayer(l)
}
function canvasResize() {
div = document.getElementById('canvas-area')
canvas = document.getElementById('map-canvas')
var w = div.scrollWidth;
var h = div.scrollHeight;
// console.log(div.clientHeight + " " + div.clientWidth)
canvas.width = w;
canvas.height = h;
canvas.style.width = w + 'px';
canvas.style.height = h + 'px';
}
canvasResize();
window.addEventListener('resize', canvasResize, false);