Contain misc functions to get portal info
Methods
-
inner findPortalGuidByPositionE6(latE6, lngE6) → {string|null}
-
Finds a portal GUID by its position. Searches through currently rendered portals, fields, and links. If the portal is not found in the current render, it checks a cache of recently seen portals.
Parameters:
Name Type Description latE6
number The latitude in E6 format.
lngE6
number The longitude in E6 format.
Returns:
string | null -The GUID of the portal at the specified location, or null if not found.
-
inner getPortalFields(guid) → {Array}
-
Searches through the fields for all fields that reference a specified portal.
Parameters:
Name Type Description guid
string The GUID of the portal to search for fields.
Returns:
Array -An array containing the GUIDs of fields associated with the portal.
-
inner getPortalFieldsCount(guid) → {number}
-
Counts the total number of fields associated with a specified portal.
Parameters:
Name Type Description guid
string The GUID of the portal.
Returns:
number -The total number of fields associated with the portal.
-
inner getPortalLinks(guid) → {Object}
-
Search through the links data for all that link from and to a portal. Returns an object with separate lists of in and out links. May or may not be as accurate as the portal details, depending on how much data the API returns.
Parameters:
Name Type Description guid
string The GUID of the portal to search for links.
Returns:
Object -An object containing arrays of incoming ('in') and outgoing ('out') link GUIDs.
-
inner getPortalLinksCount(guid) → {number}
-
Counts the total number of links (both incoming and outgoing) for a specified portal.
Parameters:
Name Type Description guid
string The GUID of the portal.
Returns:
number -The total number of links for the portal.
-
inner pushPortalGuidPositionCache(guid, latE6, lngE6)
-
Pushes a portal GUID and its position into a cache.
Parameters:
Name Type Description guid
string The GUID of the portal.
latE6
number The latitude in E6 format.
lngE6
number The longitude in E6 format.
-
inner selectPortalByLatLng(lat, lngopt)
-
Selects a portal by its latitude and longitude.
Parameters:
Name Type Attributes Description lat
number | Array | L.LatLng The latitude of the portal or an array or L.LatLng object containing both latitude and longitude.
lng
number <optional>
The longitude of the portal.
-
inner zoomToAndShowPortal(guid, latlng)
-
Zooms the map to a specific portal and shows its details if available.
Parameters:
Name Type Description guid
string The globally unique identifier of the portal.
latlng
L.LatLng | Array.<number> The latitude and longitude of the portal.