Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap - How to get back when Google Maps "Terms of use" is pressed?

I'm making this app on PhoneGap which contains a Map. On the standard Google Map, it has a "Terms of use" on the bottom right. If I click this, a whole new screen opens up. But I can't use the integrated Android Backbutton.

What do I do?

Somewhere else in the project I've used this (underneath this) javascript to get back to the previous screen - but since the "Terms of Use" screen isn't a JS-file, how do I tell it what it can/cannot do (go back to previous screen) ?

document.addEventListener("backbutton", function(e){
    e.preventDefault();
    navigator.app.backHistory();
}, true);
like image 713
Rad Avatar asked Feb 14 '13 08:02

Rad


People also ask

How do I change Google Maps back to normal?

Click on the question mark enclosed in a gray speech bubble on the bottom right of the map. You'll see this dialog where you can get help. At the bottom there's an option to Return to classic Google Maps. Click it.

Is Google Maps API no longer free?

You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).

How do I get rid of POI in Google Maps?

Click the "My Places" button just beneath the search bar. Click "Maps" and wait for the list of maps to appear down the left side of the screen. When they do, click the title of the map containing the marker that you want to remove.

Can you store Google Maps API data?

You will not pre-fetch, cache, index, or store any Content to be used outside the Service, except that you may store limited amounts of Content solely for the purpose of improving the performance of your Maps API Implementation due to network latency (and not for the purpose of preventing Google from accurately ...


1 Answers

If you are still having this problem. My solution was to capture the click event to the links in the map canvas, prevent default, get the links url, then open the url in the InAppBrowser.

$('#map_canvas').on('click', 'a', function(e){
    e.preventDefault();
    window.open($(this).attr('href'), '_blank');
});

http://docs.phonegap.com/en/2.7.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

like image 184
Raymond John Buayan Avatar answered Oct 20 '22 00:10

Raymond John Buayan