12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <!DOCTYPE html>
- <html ng-app="myApp">
- <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.25/angular.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/directives/info-window.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>
- var app = angular.module('myApp', ['ngMap']);
- app.controller('IconComplexCtrl', function($scope) {
- $scope.image = {
- url: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
- size: [20, 32],
- origin: [0,0],
- anchor: [0, 32]
- };
- $scope.shape = {
- coords: [1, 1, 1, 20, 18, 20, 18 , 1],
- type: 'poly'
- };
- $scope.beaches = [
- ['Bondi Beach', -33.890542, 151.274856, 4],
- ['Coogee Beach', -33.923036, 151.259052, 5],
- ['Cronulla Beach', -34.028249, 151.157507, 3],
- ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
- ['Maroubra Beach', -33.950198, 151.259302, 1]
- ];
- });
- </script>
- </head>
- <body>
- <div ng-controller="IconComplexCtrl">
- <map zoom="10" center="-33.9, 151.2">
- <marker ng-repeat="beach in beaches"
- icon="{{image}}"
- shape="{{shape}}"
- title="{{beach[0]}}"
- position="{{beach[1]}}, {{beach[2]}}"
- z-index="{{beach[3]}}"></marker>
- </map>
- </div>
- </body>
- </html>
|