- turn off libgdx load screen
- block contextmenu
- add osm attribution
- read initial position from url hash
- disable text stroke for firefox/linux (canvas2d is 10 times slower than chromium..)
This commit is contained in:
Hannes Janetzek
2013-08-05 02:54:21 +02:00
parent 05440542b9
commit dfec023e6e
9 changed files with 299 additions and 129 deletions

View File

@@ -1,68 +1,83 @@
<!doctype html>
<html>
<head>
<title>vtm-gdx</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<head>
<title>vtm-gdx</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- pixel and dpi are way too simple concepts for web devs, lets also have css-pixels! -->
<!-- http://www.html5rocks.com/de/mobile/touch/ -->
<!-- http://www.quirksmode.org/mobile/viewports.html -->
<!-- http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html -->
<!-- devicePixelRatio: http://coding.smashingmagazine.com/2012/08/20/towards-retina-web/ -->
<meta name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no">
<!-- pixel and dpi are way too simple concepts for web devs, lets also have css-pixels! -->
<!-- http://www.html5rocks.com/de/mobile/touch/ -->
<!-- http://www.quirksmode.org/mobile/viewports.html -->
<!-- http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html -->
<!-- devicePixelRatio: http://coding.smashingmagazine.com/2012/08/20/towards-retina-web/ -->
<meta name="viewport"
content="width=device-width, initial-scale=1, user-scalable=no">
<style>
canvas {
cursor: default;
outline: none;
position: fixed;
left: 0;
top: 0;
}
</style>
<style>
.header {
background-color: #ddd;
text-align: center;
}
gdx-canvas {
cursor: default;
outline: none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
html, body {
height: 100%;
width: 100%;
margin: 0 0 0 0;
}
<script type="text/javascript">
var mapconfig = {
tilesource : "oscimap4",
tileurl : "/osci/testing2",
zoom: "4",
latitude: "0.0",
longitude: "0.0"
}
</script>
#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;
font-family: Arial, "MS Trebuchet", sans-serif;
}
#credits a {
color: white;
text-decoration: none;
font-variant: small-caps;
}
</style>
</head>
<script type="text/javascript">
var mapconfig = {
tilesource : "oscimap4",
tileurl : "/tiles/vtm",
zoom : "2",
latitude : "0.0",
longitude : "0.0"
}
</script>
<body>
</head>
<div align="center" id="embed-org.oscim.gdx.GwtDefinition"></div>
<body>
<script type="text/javascript" src="js/_tessellate.js"></script>
<script type="text/javascript" src="js/tessellate.js"></script>
<script type="text/javascript" src="js/_tessellate.js"></script>
<script type="text/javascript" src="js/tessellate.js"></script>
<script type="text/javascript"
<script type="text/javascript"
src="org.oscim.gdx.GwtDefinition/org.oscim.gdx.GwtDefinition.nocache.js"></script>
</body>
<script>
function handleMouseDown(evt) {
evt.preventDefault();
evt.stopPropagation();
evt.target.style.cursor = 'default';
}
<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>
function handleMouseUp(evt) {
evt.preventDefault();
evt.stopPropagation();
evt.target.style.cursor = '';
}
document.getElementById('embed-org.oscim.gdx.GwtDefinition')
.addEventListener('mousedown', handleMouseDown, false);
document.getElementById('embed-org.oscim.gdx.GwtDefinition')
.addEventListener('contextmenu', handleMouseDown, false);
document.getElementById('embed-org.oscim.gdx.GwtDefinition')
.addEventListener('mouseup', handleMouseUp, false);
</script>
</html>