Software Archive
Read-only legacy content
17061 Discussions

open google maps navigation

giuseppe_s_
Beginner
867 Views
prejudice are new 'm doing tests can tell me how I can open the browser from my app using XDK intel ? I have a lot of confusion
if there is a source code would be perfect thanks
 thanks
0 Kudos
1 Solution
John_H_Intel2
Employee
867 Views

You need to know an external apps protocol handler to be able to launch it. If you want to open google maps, you can use a function such as this. It uses the intex.xdk.device plugin, so you would need to include that (by checking a box) in the project settings. There are probably other ways, but this works :)

function launchGoogleMaps()

    {
        //var url = "http://google.com/maps?saddr="+currentLatitude+","+currentLongitude+"&daddr=5700+Linglestown+Rd+Harrisburg,+PA+17112";
        var url = "googlemaps://?center=40.765819,-73.975866&zoom=14&views=traffic";
        //alert(url);
        //console.log(url);
        intel.xdk.device.launchExternal(url);
    }

View solution in original post

0 Kudos
8 Replies
John_H_Intel2
Employee
868 Views

You need to know an external apps protocol handler to be able to launch it. If you want to open google maps, you can use a function such as this. It uses the intex.xdk.device plugin, so you would need to include that (by checking a box) in the project settings. There are probably other ways, but this works :)

function launchGoogleMaps()

    {
        //var url = "http://google.com/maps?saddr="+currentLatitude+","+currentLongitude+"&daddr=5700+Linglestown+Rd+Harrisburg,+PA+17112";
        var url = "googlemaps://?center=40.765819,-73.975866&zoom=14&views=traffic";
        //alert(url);
        //console.log(url);
        intel.xdk.device.launchExternal(url);
    }

0 Kudos
PaulF_IntelCorp
Employee
867 Views

If you simply want to launch Google Maps in the device browser, you can use the inAppBrowser plugin. See the doc page for details: https://github.com/apache/cordova-plugin-inappbrowser

0 Kudos
giuseppe_s_
Beginner
867 Views
you can explain to me to come work is the plug-in Cordova ?

the source of Example dove goes Put In which part of the program

for example
navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
    destinationType: Camera.DestinationType.DATA_URL
});

function onSuccess(imageData) {
    var image = document.getElementById('myImage');
    image.src = "data:image/jpeg;base64," + imageData;
}

function onFail(message) {
    alert('Failed because: ' + message);
}
This part of the code which is placed inside js .. ??

where you call this function ???

I am new and nn know where to get information one can help me thanks
0 Kudos
PaulF_IntelCorp
Employee
867 Views

I recommend you take a look at some of the samples to figure out how things work. In particular, there is a "gelolcation demo" that might help. Try "Start a New Project" then "Samples and Demos" then "General" then "HTML5+Cordova"

0 Kudos
PaulF_IntelCorp
Employee
867 Views

I'm sorry, but I don't understand what you want us to do with that link... Please note that we keep track of a large number of developers and threads, so providing some context always makes it much easier to help answer your questions.

0 Kudos
giuseppe_s_
Beginner
867 Views
HIS plug That allows you to recall the navigator google

example
launchnavigator.navigate (
"London, United Kingdom",
"Manchester , UK "
function () {
alert ( " success Plugins " ) ;
} ,
function ( error ) {
alert ( " Plugin Error : " + error ) ;
} ) ;
 
can you help me on how to how to use google gcm " notidiche Pusch through intel XDK are some examples???

 

0 Kudos
PaulF_IntelCorp
Employee
867 Views

You referred to a specific plugin in an earlier post. That plugin has an example that you can use (I don't know if it helps with your question regarding push). That example can be found here: https://github.com/dpa99c/phonegap-launch-navigator-example

In general, when you find examples for plugins, one way to try that code is to create a blank HTML5+Cordova project from a template and then copy the example code into that new blank project.

Sorry, but we do not have examples for the large number of third-party plugins that are available. The plugin authors are your best resource for those examples. Also, The Intel XDK creates a Cordova application, so any examples you find that are for Cordova or PhoneGap apply to the Intel XDK.

0 Kudos
Reply