Matthew Garton
Posts: 0
Joined: Fri Jul 31, 2015 2:22 am

Google map angular set centre position

Hi,
I am trying to set the centre position of the google map component in an Angular app using the controller.

When I put {{variable_x}} into the centre field of the map component in the design view the html code comes out wrong when debugging the app.

I don't know a great deal about this but it almost seems like dependency injection does not work as ui-gmap-google-map center="{{variable_x}}" should not look like this {{variable_x}} should be a value???

In the controller I am setting variable x and writing it to the console like this:
$scope.variable_x= "{'latitude': '40.1451', 'longitude': '-99.6680'}";
console.log($scope.variable_x)

Console output
{'latitude': '40.1451', 'longitude': '-99.6680'}

With this in place all I get is white space where the map is.

I know you do not support custom code but how do I dynamically set the centre of the map - nothing in the documentation here:

I have read this over and over again but I cannot see what is missing:

https://devcenter.appery.io/documenta...

Matthew Garton
Posts: 0
Joined: Fri Jul 31, 2015 2:22 am

Google map angular set centre position

This was the html tag that is coming out unexpectedly:

""

Matthew Garton
Posts: 0
Joined: Fri Jul 31, 2015 2:22 am

Google map angular set centre position

Can't paste the html :(

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Google map angular set centre position

Hello Matthew,
Please follow this tutorial "Building an app with Google Maps and AngularJS":

https://devcenter.appery.io/tutorials...

Return to “Issues”