Vincent
Posts: 0
Joined: Mon Jul 21, 2014 11:18 am

How to invoke Google Service Method

i'm following the tutorial, Using the Google Maps API, and trying to invoke a public method. http://developer.android.com/referenc...

I've tried to invoke in initialize, but it does not work.

function initialize(){
console.log('Initializing...');

Code: Select all

 map = Apperyio("google_map").gmap; 
 map.setMyLocationEnabled(true); 
 if (!map) 
 { 
     setDelay(); 
 } 
 else 
 { 
     directionsDisplay = new google.maps.DirectionsRenderer(); 

 } 

}

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to invoke Google Service Method

Hi Vincent,

The map is not ready yet when you call setMyLocationEnabled. Please move this code:premap.setMyLocationEnabled(true); /preBefore or after:predirectionsDisplay = new google.maps.DirectionsRenderer();/pre

Vincent
Posts: 0
Joined: Mon Jul 21, 2014 11:18 am

How to invoke Google Service Method

Hi,

I've shifted the code to after, but a Uncaught TypeError: undefined is not a function is triggered:

function initialize(){
console.log('Initializing...');

Code: Select all

 map = Apperyio("google_map").gmap; 
 // 
 if (!map) 
 { 
     setDelay(); 
 } 
 else 
 { 
     directionsDisplay = new google.maps.DirectionsRenderer(); 
     map.setMyLocationEnabled(true); 

 }
Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to invoke Google Service Method

Hi Vincent,

Please give us your app public link and describe steps to reproduce this issue.

Regards.

Vincent
Posts: 0
Joined: Mon Jul 21, 2014 11:18 am

How to invoke Google Service Method

http://appery.io/app/mobile-frame?src...

followed tutorial Using the Google Maps API.

Added to GoogleMapJS:

function initialize(){
console.log('Initializing...');

Code: Select all

 map = Apperyio("google_map").gmap; 
 // 
 if (!map) 
 { 
     setDelay(); 
 } 
 else 
 { 
     console.log('generating map'); 
     directionsDisplay = new google.maps.DirectionsRenderer(); 
     console.log('generating mylocation'); 
     map.setMyLocationEnabled(true); 

 } 

}

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to invoke Google Service Method

Hi Vincent,

Unfortunatly, you can not use "setMyLocationEnabled" method cause of there is no such method in Google Maps Javascript API V3.

Please see more about this avaliable API here: https://developers.google.com/maps/do...

Also if you can not manage to fix this problem please describe what exactly you want to implement.

Regards.

Vincent
Posts: 0
Joined: Mon Jul 21, 2014 11:18 am

How to invoke Google Service Method

Hi,

I would like to have the my location button as per google maps app in screenshot. Ive seen this in other non google app, just that im not sure if its V2 or V3.Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to invoke Google Service Method

Hi Vincent,

Please pass following tutorial to understand how to implement "my location" button.

http://devcenter.appery.io/tutorials/...

Regards.

Return to “Issues”