0

Allow filter functions to specify icons

This commit is contained in:
Andrew Chin
2012-04-15 12:00:44 -04:00
parent 07bdf2aa93
commit 27acb575f7
2 changed files with 12 additions and 11 deletions

View File

@@ -168,11 +168,17 @@ def main():
for poi in rset._pois['TileEntities']: for poi in rset._pois['TileEntities']:
result = filter_function(poi) result = filter_function(poi)
if result: if result:
markerSetDict[name]['raw'].append(dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True)) d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True)
if "icon" in poi:
d.update({"icon": poi['icon']})
markerSetDict[name]['raw'].append(d)
for poi in rset._pois['Players']: for poi in rset._pois['Players']:
result = filter_function(poi) result = filter_function(poi)
if result: if result:
markerSetDict[name]['raw'].append(dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True)) d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, createInfoWindow=True)
if "icon" in poi:
d.update({"icon": poi['icon']})
markerSetDict[name]['raw'].append(d)
#print markerSetDict #print markerSetDict
with open(os.path.join(destdir, "markersDB.js"), "w") as output: with open(os.path.join(destdir, "markersDB.js"), "w") as output:

View File

@@ -437,22 +437,17 @@ overviewer.views.SignControlView = Backbone.View.extend({
if (!markersDB[groupName].created) { if (!markersDB[groupName].created) {
for (j in markersDB[groupName].raw) { for (j in markersDB[groupName].raw) {
var entity = markersDB[groupName].raw[j]; var entity = markersDB[groupName].raw[j];
if (entity['id'] == 'Player') { if (entity['icon']) {
iconURL = "http://overviewer.org/avatar/" iconURL = entity['icon'];
+ entity['EntityId'];
} else if (entity['id'] == 'PlayerSpawn') {
iconURL = overviewerConfig.CONST.image.bedMarker;
} else if (entity['id'] == 'Sign') {
iconURL = overviewerConfig.CONST.image.signMarker;
} else { } else {
iconURL = overviewerConfig.CONST.image.defaultMarker; iconURL = dataRoot[i].icon;
} }
var marker = new google.maps.Marker({ var marker = new google.maps.Marker({
'position': overviewer.util.fromWorldToLatLng(entity.x, 'position': overviewer.util.fromWorldToLatLng(entity.x,
entity.y, entity.z, overviewer.mapView.options.currentTileSet), entity.y, entity.z, overviewer.mapView.options.currentTileSet),
'map': overviewer.map, 'map': overviewer.map,
'title': jQuery.trim(entity.text), 'title': jQuery.trim(entity.text),
'icon': dataRoot[i].icon, 'icon': iconURL,
'visible': false 'visible': false
}); });
if (entity.createInfoWindow) { if (entity.createInfoWindow) {