Improved permalink/portal link

Now shows a dialog from which you can:
* share the permalink using the standard android share feature
* copy the link to the clipboard
* open the intel map link with an installed browser
* show the map with an installed map application (that supports geo: URIs)
This commit is contained in:
fkloft
2013-07-21 00:51:21 +02:00
parent 663a8f0dbc
commit 2b7ac5605b
14 changed files with 229 additions and 18 deletions

View File

@ -52,7 +52,6 @@ window.renderPortalDetails = function(guid) {
var poslinks = 'window.showPortalPosLinks('+lat+','+lng+',\''+escapeJavascriptString(d.portalV2.descriptiveText.TITLE)+'\')';
var portalDetailObj = window.getPortalDescriptionFromDetailsExtended(d);
var portalDetailedDescription = '';
if(portalDetailObj) {
@ -101,8 +100,12 @@ window.renderPortalDetails = function(guid) {
+ randDetails
+ resoDetails
+ '<div class="linkdetails">'
+ '<aside><a href="'+perma+'" onclick="return androidCopy(this.href)" title="Create a URL link to this portal" >Portal link</a></aside>'
+ '<aside><a onclick="'+poslinks+'" title="Link to alternative maps (Google, etc)">Map links</a></aside>'
+ (
typeof android !== 'undefined' && android && android.intentPosLink // Android handles both links via a dialog
? '<aside><a onclick="'+poslinks+'" title="Create a URL link to this portal" >Portal link</a></aside>'
: '<aside><a href="'+perma+'" onclick="return androidCopy(this.href)" title="Create a URL link to this portal" >Portal link</a></aside>'
+ '<aside><a onclick="'+poslinks+'" title="Link to alternative maps (Google, etc)">Map links</a></aside>'
)
+ '<aside><a onclick="window.reportPortalIssue()" title="Report issues with this portal to Niantic/Google">Report issue</a></aside>'
+ '</div>'
);

View File

@ -176,7 +176,7 @@ window.showPortalPosLinks = function(lat, lng, name) {
}
if (typeof android !== 'undefined' && android && android.intentPosLink) {
android.intentPosLink(lat, lng, encoded_name);
android.intentPosLink(lat, lng, map.getZoom(), name);
} else {
var qrcode = '<div id="qrcode"></div>';
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
@ -200,6 +200,15 @@ window.androidCopy = function(text) {
return false;
}
window.androidPermalink = function() {
if(typeof android === 'undefined' || !android || !android.copy)
return true; // i.e. execute other actions
var center = map.getCenter();
android.intentPosLink(center.lat, center.lng, map.getZoom(), null);
return false;
}
window.reportPortalIssue = function(info) {
var t = 'Redirecting you to a Google Help Page.\n\nThe text box contains all necessary information. Press CTRL+C to copy it.';
var d = window.portals[window.selectedPortal].options.details;