add bing maps link to "map links" dialog
the encoded_name no longer includes the space/brackets - so these are now added in the java app - which makes more sense anyway unknown names (shouldn't happen) are now named 'unknown' rather than not specified
This commit is contained in:
parent
11e9663e60
commit
73487d7e50
@ -154,20 +154,22 @@ window.rangeLinkClick = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.showPortalPosLinks = function(lat, lng, name) {
|
window.showPortalPosLinks = function(lat, lng, name) {
|
||||||
var encoded_name = '';
|
var encoded_name = 'undefined';
|
||||||
if(name !== undefined) {
|
if(name !== undefined) {
|
||||||
encoded_name = encodeURIComponent(' (' + name + ')');
|
encoded_name = encodeURIComponent(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof android !== 'undefined' && android && android.intentPosLink) {
|
if (typeof android !== 'undefined' && android && android.intentPosLink) {
|
||||||
android.intentPosLink(lat, lng, encoded_name);
|
android.intentPosLink(lat, lng, encoded_name);
|
||||||
} else {
|
} else {
|
||||||
var qrcode = '<div id="qrcode"></div>';
|
var qrcode = '<div id="qrcode"></div>';
|
||||||
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
|
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
|
||||||
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+encoded_name+'">Google Maps</a>';
|
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+'%20('+encoded_name+')">Google Maps</a>';
|
||||||
|
var bingmaps = '<a href="http://www.bing.com/maps/?v=2&cp='+lat+'~'+lng+'&lvl=16&sp=Point.'+lat+'_'+lng+'_'+encoded_name+'___">Bing Maps</a>';
|
||||||
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OpenStreetMap</a>';
|
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OpenStreetMap</a>';
|
||||||
var latLng = '<span><' + lat + ',' + lng +'></span>';
|
var latLng = '<span><' + lat + ',' + lng +'></span>';
|
||||||
dialog({
|
dialog({
|
||||||
html: '<div style="text-align: center;">' + qrcode + script + gmaps + '; ' + osm + '<br />' + latLng + '</div>',
|
html: '<div style="text-align: center;">' + qrcode + script + gmaps + '; ' + bingmaps + '; ' + osm + '<br />' + latLng + '</div>',
|
||||||
title: name,
|
title: name,
|
||||||
id: 'poslinks'
|
id: 'poslinks'
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ public class IITC_JSInterface {
|
|||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void intentPosLink(String lat, String lng, String portal_name) {
|
public void intentPosLink(String lat, String lng, String portal_name) {
|
||||||
String uri = "geo:" + lat + "," + lng + "?q=" + lat + "," + lng
|
String uri = "geo:" + lat + "," + lng + "?q=" + lat + "," + lng
|
||||||
+ portal_name;
|
+ "%20(" + portal_name + ")";
|
||||||
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
|
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
|
||||||
Uri.parse(uri));
|
Uri.parse(uri));
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user