123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html ng-app="ngMap">
- <head>
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
- <script src="https://maps.google.com/maps/api/js?sensor=false"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
- <script src="scripts/app.js"></script>
- <!-- build:js scripts/ng-map.min.js -->
- <script src="../app/scripts/app.js"></script>
- <script src="../app/scripts/directives/map_controller.js"></script>
- <script src="../app/scripts/directives/map.js"></script>
- <script src="../app/scripts/directives/marker.js"></script>
- <script src="../app/scripts/directives/shape.js"></script>
- <script src="../app/scripts/services/geo_coder.js"></script>
- <script src="../app/scripts/services/navigator_geolocation.js"></script>
- <script src="../app/scripts/services/attr2_options.js"></script>
- <!-- endbuild -->
- <script>
- function MyCtrl($scope) {
- $scope.positions =[ [40.71, -74.21], [40.72, -74.20], [40.73, -74.19],
- [40.74, -74.18], [40.75, -74.17], [40.76, -74.16], [40.77, -74.15]];
- $scope.positions2 =[ {pos:[40.71, -74.21]}, {pos:[40.72, -74.20]}, {pos: [40.73, -74.19]},
- {pos:[40.74, -74.18]}, {pos:[40.75, -74.17]}, {pos:[40.76, -74.16]}, {pos:[40.77, -74.15]}];
- }
- </script>
- </head>
- <body>
- <div ng-controller="MyCtrl">
- <map zoom="11" center="[40.74, -74.18]">
- <marker ng-repeat="p in positions" position="{{p}}" title="pos: {{p}}"></marker>
- </map>
- <map zoom="11" center="[40.74, -74.18]">
- <marker ng-repeat="p in positions2" position="{{p.pos}}" title="pos: {{p.pos}}"></marker>
- </map>
- </div>
- </body>
- </html>
|