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) {
|
||||
var encoded_name = '';
|
||||
var encoded_name = 'undefined';
|
||||
if(name !== undefined) {
|
||||
encoded_name = encodeURIComponent(' (' + name + ')');
|
||||
encoded_name = encodeURIComponent(name);
|
||||
}
|
||||
|
||||
if (typeof android !== 'undefined' && android && android.intentPosLink) {
|
||||
android.intentPosLink(lat, lng, encoded_name);
|
||||
} else {
|
||||
var qrcode = '<div id="qrcode"></div>';
|
||||
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 latLng = '<span><' + lat + ',' + lng +'></span>';
|
||||
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,
|
||||
id: 'poslinks'
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ public class IITC_JSInterface {
|
||||
@JavascriptInterface
|
||||
public void intentPosLink(String lat, String lng, String portal_name) {
|
||||
String uri = "geo:" + lat + "," + lng + "?q=" + lat + "," + lng
|
||||
+ portal_name;
|
||||
+ "%20(" + portal_name + ")";
|
||||
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
|
||||
Uri.parse(uri));
|
||||
context.startActivity(intent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user