Fancy icons for signposts and spawn, plus info windows for signposts
Thanks to gabrielcrowe for the signpost icon.
This commit is contained in:
@@ -144,6 +144,10 @@ class QuadtreeGen(object):
|
|||||||
if not os.path.exists(tileDir): os.mkdir(tileDir)
|
if not os.path.exists(tileDir): os.mkdir(tileDir)
|
||||||
blank.save(os.path.join(tileDir, "blank."+self.imgformat))
|
blank.save(os.path.join(tileDir, "blank."+self.imgformat))
|
||||||
|
|
||||||
|
# copy web assets into destdir:
|
||||||
|
for root, dirs, files in os.walk(os.path.join(util.get_program_path(), "web_assets")):
|
||||||
|
for f in files:
|
||||||
|
shutil.copy(os.path.join(root, f), self.destdir)
|
||||||
|
|
||||||
if skipjs:
|
if skipjs:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -2,11 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||||
<style type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||||
html { height: 100% }
|
|
||||||
body { height: 100%; margin: 0px; padding: 0px ; background-color: #000; }
|
|
||||||
#mcmap { height: 100% }
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript" src="markers.js"></script>
|
<script type="text/javascript" src="markers.js"></script>
|
||||||
<script type="text/javascript" src="regions.js"></script>
|
<script type="text/javascript" src="regions.js"></script>
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
@@ -139,6 +135,18 @@
|
|||||||
|
|
||||||
var markersInit = false;
|
var markersInit = false;
|
||||||
|
|
||||||
|
function prepareSignMarker(marker, item) {
|
||||||
|
|
||||||
|
var c = "<div class=\"infoWindow\"><img src=\"signpost.png\" /><p>" + item.msg.replace(/\n/g,"<br/>") + "</p></div>";
|
||||||
|
var infowindow = new google.maps.InfoWindow({
|
||||||
|
content: c
|
||||||
|
});
|
||||||
|
google.maps.event.addListener(marker, 'click', function() {
|
||||||
|
infowindow.open(map,marker);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function initMarkers() {
|
function initMarkers() {
|
||||||
if (markersInit) { return; }
|
if (markersInit) { return; }
|
||||||
|
|
||||||
@@ -147,12 +155,25 @@
|
|||||||
for (i in markerData) {
|
for (i in markerData) {
|
||||||
var item = markerData[i];
|
var item = markerData[i];
|
||||||
|
|
||||||
|
// a default:
|
||||||
|
var iconURL = '';
|
||||||
|
|
||||||
|
if (item.type == 'spawn') { iconURL = 'http://google-maps-icons.googlecode.com/files/home.png';}
|
||||||
|
if (item.type == 'sign') { iconURL = 'signpost_icon.png';}
|
||||||
|
|
||||||
var converted = fromWorldToLatLng(item.x, item.y, item.z);
|
var converted = fromWorldToLatLng(item.x, item.y, item.z);
|
||||||
var marker = new google.maps.Marker({
|
var marker = new google.maps.Marker({
|
||||||
position: converted,
|
position: converted,
|
||||||
map: map,
|
map: map,
|
||||||
title: item.msg
|
title: item.msg,
|
||||||
});
|
icon: iconURL
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (item.type == 'sign') {
|
||||||
|
prepareSignMarker(marker, item);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
web_assets/signpost-shadow.png
Normal file
BIN
web_assets/signpost-shadow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 368 B |
BIN
web_assets/signpost.png
Normal file
BIN
web_assets/signpost.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 708 B |
BIN
web_assets/signpost_icon.png
Normal file
BIN
web_assets/signpost_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 253 B |
18
web_assets/style.css
Normal file
18
web_assets/style.css
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
html { height: 100% }
|
||||||
|
body { height: 100%; margin: 0px; padding: 0px ; background-color: #000; }
|
||||||
|
#mcmap { height: 100% }
|
||||||
|
|
||||||
|
.infoWindow {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoWindow>img {
|
||||||
|
width:80px;
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoWindow>p {
|
||||||
|
text-align: center;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user