Tweaked the viewstate link GUI
Moved it to the bottom of the screen, as it was in the way of the existing controls on the top-right. Added it as a map conrol instead of a simple div. Improved the styling a bit
This commit is contained in:
@@ -17,6 +17,17 @@ function prepareSignMarker(marker, item) {
|
|||||||
|
|
||||||
function drawMapControls() {
|
function drawMapControls() {
|
||||||
|
|
||||||
|
// viewstate link
|
||||||
|
var viewStateDiv = document.createElement('DIV');
|
||||||
|
|
||||||
|
//<div id="link" style="border:1px solid black;background-color:white;color:black;position:absolute;top:5px;right:5px"></div>
|
||||||
|
|
||||||
|
viewStateDiv.id="link";
|
||||||
|
|
||||||
|
|
||||||
|
map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(viewStateDiv);
|
||||||
|
|
||||||
|
|
||||||
// compass rose, in the top right corner
|
// compass rose, in the top right corner
|
||||||
var compassDiv = document.createElement('DIV');
|
var compassDiv = document.createElement('DIV');
|
||||||
|
|
||||||
@@ -222,7 +233,7 @@ function initMarkers() {
|
|||||||
|
|
||||||
|
|
||||||
function makeLink() {
|
function makeLink() {
|
||||||
var a=location.href.substring(0,location.href.lastIndexOf("/")+1)
|
var a=location.href.substring(0,location.href.lastIndexOf(location.search))
|
||||||
+ "?lat=" + map.getCenter().lat().toFixed(6)
|
+ "?lat=" + map.getCenter().lat().toFixed(6)
|
||||||
+ "&lng=" + map.getCenter().lng().toFixed(6)
|
+ "&lng=" + map.getCenter().lng().toFixed(6)
|
||||||
+ "&zoom=" + map.getZoom();
|
+ "&zoom=" + map.getZoom();
|
||||||
@@ -287,7 +298,7 @@ function initialize() {
|
|||||||
initRegions();
|
initRegions();
|
||||||
drawMapControls();
|
drawMapControls();
|
||||||
|
|
||||||
makeLink();
|
//makeLink();
|
||||||
|
|
||||||
// Make the link again whenever the map changes
|
// Make the link again whenever the map changes
|
||||||
google.maps.event.addListener(map, 'zoom_changed', function() {
|
google.maps.event.addListener(map, 'zoom_changed', function() {
|
||||||
|
|||||||
@@ -14,6 +14,5 @@
|
|||||||
</head>
|
</head>
|
||||||
<body onload="initialize()">
|
<body onload="initialize()">
|
||||||
<div id="mcmap" style="width:100%; height:100%"></div>
|
<div id="mcmap" style="width:100%; height:100%"></div>
|
||||||
<div id="link" style="border:1px solid black;background-color:white;color:black;position:absolute;top:5px;right:5px"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -40,3 +40,18 @@ body { height: 100%; margin: 0px; padding: 0px ; background-color: #000; }
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#link {
|
||||||
|
background-color: #fff; /* fallback */
|
||||||
|
background-color: rgba(255,255,255,0.55);
|
||||||
|
border: 1px solid rgb(0, 0, 0);
|
||||||
|
font-size: 9pt;
|
||||||
|
padding-left: 2px;
|
||||||
|
padding-right: 2px;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#link:hover {
|
||||||
|
background-color: #fff; /* fallback */
|
||||||
|
background-color: rgba(255,255,255,0.8);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user