IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
291 stars 109 forks source link

Add share link in portal view #563

Closed Eccenux closed 1 year ago

Eccenux commented 2 years ago

I could make a plugin for sharing links, but I think this should be built into the core IITC. Same as map link is.

This share link allows you to open Ingress scanner on an exact portal.

Here is a quick example on how to build the link:

function shareUrl(guid, lat, lon) {
    const appid = `576505181`;
    const prefix = `https://link.ingress.com/?link=https%3A%2F%2Fintel.ingress.com%2Fportal%2F`;
    const mid = `&apn=com.nianticproject.ingress&isi=${appid}&ibi=com.google.ingress&ifl=https%3A%2F%2Fapps.apple.com%2Fapp%2Fingress%2Fid${appid}&ofl=https%3A%2F%2Fintel.ingress.com%2Fintel%3Fpll%3D`;

    return `${prefix}${guid}${mid}${lat}%2C${lon}`;
}
// generate share url for selected portal:
shareUrl(selectedPortal, portals[selectedPortal]._latlng.lat, portals[selectedPortal]._latlng.lng)
Eccenux commented 2 years ago

I think the link should be here, next to map links:

Maybe call it "Scanner link" or "App link" or "Prime link". Not sure what would be more intuitive. Not sure all agents remember that it's a Scanner 🙂