123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <!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.allShapes = [
- {name: "polyline", path: [[40.74,-74.18],[40.64,-74.10],[40.54,-74.05],[40.44,-74]]},
- {name: "polygon", paths: [[40.74,-74.18],[40.64,-74.18],[40.84,-74.08],[40.74,-74.18]]},
- {name: "rectangle", bounds: [[40.74,-74.18], [40.78,-74.14]]},
- {name: "circle", center:[40.70,-74.14], radius:4000}
- ];
- console.log($scope);
- }
- </script>
- </head>
- <body>
- <div ng-controller="MyCtrl">
- <map zoom="11" center="[40.74, -74.18]">
- <shape ng-repeat="shape in allShapes"
- name="{{shape.name}}"
- stroke-color="#FF0000"
- stroke-opacity="0.8"
- path="{{shape.path}}"
- paths="{{shape.paths}}"
- bounds="{{shape.bounds}}"
- center="{{shape.center}}"
- radius="{{shape.radius}}"
- stroke-weight="2"></shape>
- </map>
- </div>
- </body>
- </html>
|