chat: guid is no longer available

This commit is contained in:
fkloft 2015-01-16 20:41:31 +01:00
parent e4daeaa9cd
commit 6a0e021e30
3 changed files with 15 additions and 1 deletions

View File

@ -304,7 +304,7 @@ window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel, is
case 'PORTAL':
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
var perma = '/intel?ll='+latlng[0]+','+latlng[1]+'&z=17&pll='+latlng[0]+','+latlng[1];
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false';
var js = 'window.selectPortalByLatLng('+latlng[0]+', '+latlng[1]+');return false';
msg += '<a onclick="'+js+'"'
+ ' title="'+markup[1].address+'"'

View File

@ -269,6 +269,19 @@ window.zoomToAndShowPortal = function(guid, latlng) {
urlPortal = guid;
}
window.selectPortalByLatLng = function(lat, lng) {
for(var guid in window.portals) {
var latlng = window.portals[guid].getLatLng();
if(latlng.lat == lat && latlng.lng == lng) {
renderPortalDetails(guid);
return;
}
}
// not currently visible
urlPortalLL = [lat, lng];
map.setView(urlPortalLL, 17);
};
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();

View File

@ -205,6 +205,7 @@ window.DEG2RAD = Math.PI / 180;
// getters/setters, but if you are careful enough, this works.
window.refreshTimeout = undefined;
window.urlPortal = null;
window.urlPortalLL = null;
window.selectedPortal = null;
window.portalRangeIndicator = null;
window.portalAccessIndicator = null;