add linkAdded and fieldAdded hooks, to mirror the portalAdded hook
This commit is contained in:
parent
d07164685a
commit
aad3c77ff9
@ -26,6 +26,8 @@
|
|||||||
// shown at all. Injection point is in
|
// shown at all. Injection point is in
|
||||||
// code/map_data.js#renderPortal near the end. Will hand
|
// code/map_data.js#renderPortal near the end. Will hand
|
||||||
// the Leaflet CircleMarker for the portal in "portal" var.
|
// the Leaflet CircleMarker for the portal in "portal" var.
|
||||||
|
// linkAdded: called when a link is about to be added to the map
|
||||||
|
// fieldAdded: called when a field is about to be added to the map
|
||||||
// portalDetailsUpdated: fired after the details in the sidebar have
|
// portalDetailsUpdated: fired after the details in the sidebar have
|
||||||
// been (re-)rendered Provides data about the portal that
|
// been (re-)rendered Provides data about the portal that
|
||||||
// has been selected.
|
// has been selected.
|
||||||
@ -49,7 +51,8 @@ window._hooks = {}
|
|||||||
window.VALID_HOOKS = [
|
window.VALID_HOOKS = [
|
||||||
'portalSelected',
|
'portalSelected',
|
||||||
'mapDataRefreshStart', 'mapDataRefreshEnd',
|
'mapDataRefreshStart', 'mapDataRefreshEnd',
|
||||||
'portalAdded', 'portalDetailsUpdated',
|
'portalAdded', 'linkAdded', 'fieldAdded',
|
||||||
|
'portalDetailsUpdated',
|
||||||
'publicChatDataAvailable', 'factionChatDataAvailable',
|
'publicChatDataAvailable', 'factionChatDataAvailable',
|
||||||
'requestFinished', 'nicknameClicked',
|
'requestFinished', 'nicknameClicked',
|
||||||
'geoSearch', 'iitcLoaded'];
|
'geoSearch', 'iitcLoaded'];
|
||||||
|
@ -397,6 +397,8 @@ window.Render.prototype.createFieldEntity = function(ent) {
|
|||||||
addPortalLinkedField(ent[2].capturedRegion.vertexB.guid);
|
addPortalLinkedField(ent[2].capturedRegion.vertexB.guid);
|
||||||
addPortalLinkedField(ent[2].capturedRegion.vertexC.guid);
|
addPortalLinkedField(ent[2].capturedRegion.vertexC.guid);
|
||||||
|
|
||||||
|
runHooks('fieldAdded',{field: poly});
|
||||||
|
|
||||||
window.fields[ent[0]] = poly;
|
window.fields[ent[0]] = poly;
|
||||||
|
|
||||||
// TODO? postpone adding to the layer??
|
// TODO? postpone adding to the layer??
|
||||||
@ -440,6 +442,8 @@ window.Render.prototype.createLinkEntity = function(ent,faked) {
|
|||||||
data: ent[2]
|
data: ent[2]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
runHooks('linkAdded', {link: poly});
|
||||||
|
|
||||||
window.links[ent[0]] = poly;
|
window.links[ent[0]] = poly;
|
||||||
|
|
||||||
// only add the link to the layer if it's long enough to be seen
|
// only add the link to the layer if it's long enough to be seen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user