angularjs - Adding location to Google Map on page load with Angular UI -


thanks @ajoslin have working google map using angularui , angularjs.

unfortunately there 2 things can't figure out how may have google map api , lack of understanding of.

when map loads, have location wish load marker on it. how do that?

i wish set ng-click="mymap.panto(marker.getposition()) not new marker initial location, marker have since i'm removing add marker functionality out, once can figure 1 out.

here working jsfiddle

http://jsfiddle.net/jorgecas99/xmw6u/

i think should achievable setting tilesloaded event, didnt manage way, ended using simple "trick", watching mymap appear.

  $scope.$watch('mymap', function(){     $scope.sethome();   });    $scope.sethome = function() {     $scope.homemarker = new google.maps.marker({     map: $scope.mymap,     position: $scope.mapoptions.center   });   } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -