Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Update: links below seem to be dead. Use this one: <a href="http://angular-ui.github.io/angular-google-maps/#!/" rel="nofollow noreferrer">http://angular-ui.github.io/angular-google-maps/#!/</a></em></p> <p>It sounds like the example here is what you are asking for: <a href="http://nlaplante.github.io/angular-google-maps/#!/demo" rel="nofollow noreferrer">http://nlaplante.github.io/angular-google-maps/#!/demo</a></p> <p>Have a look at the source of the DemoController (<a href="http://nlaplante.github.io/angular-google-maps/js/demo-controller.js" rel="nofollow noreferrer">http://nlaplante.github.io/angular-google-maps/js/demo-controller.js</a>):</p> <pre><code>module.controller("DemoController", function ($scope, $location) { $scope.$watch("activeTab", function (newValue, oldValue) { if (newValue === oldValue) { return; } if ($location.path() != $scope.activeTab) { $location.path($scope.activeTab); } }); $scope.getNavClass = function (item) { return item == $scope.activeTab ? "active" : ""; }; // default location $scope.center = { latitude: 45, longitude: -73 }; $scope.geolocationAvailable = navigator.geolocation ? true : false; $scope.latitude = null; $scope.longitude = null; $scope.zoom = 4; $scope.markers = []; $scope.markerLat = null; $scope.markerLng = null; $scope.addMarker = function () { $scope.markers.push({ latitude: parseFloat($scope.markerLat), longitude: parseFloat($scope.markerLng) }); $scope.markerLat = null; $scope.markerLng = null; }; $scope.findMe = function () { if ($scope.geolocationAvailable) { navigator.geolocation.getCurrentPosition(function (position) { $scope.center = { latitude: position.coords.latitude, longitude: position.coords.longitude }; $scope.$apply(); }, function () { }); } }; }); </code></pre> <p>You can use $scope.center to tell the map where to center itself.</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload