add in portal click support and highlighters to new code

This commit is contained in:
Jon Atkins 2013-08-23 04:28:09 +01:00
parent 4f5f47831a
commit 91a75a0f2f

View File

@ -111,7 +111,7 @@ window.Render.prototype.deleteFieldEntity = function(guid) {
if (guid in window.fields) { if (guid in window.fields) {
var f = window.fields[guid]; var f = window.fields[guid];
fieldsLayer.removeLayer(f); fieldsLayer.removeLayer(f);
delete window.fields[f]; delete window.fields[guid];
} }
} }
@ -161,6 +161,11 @@ window.Render.prototype.createPortalEntity = function(ent) {
var marker = this.createMarker(ent, portalLevel, latlng, team); var marker = this.createMarker(ent, portalLevel, latlng, team);
marker.on('click', function() { window.renderPortalDetails(ent[0]); });
marker.on('dblclick', function() { window.renderPortalDetails(ent[0]); window.map.setView(latlng, 17); });
// portal highlighters
highlightPortal(marker);
window.runHooks('portalAdded', {portal: marker}); window.runHooks('portalAdded', {portal: marker});