icon-complex.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html ng-app="myApp">
  3. <head>
  4. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  5. <script src="https://maps.google.com/maps/api/js?sensor=false"></script>
  6. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.js"></script>
  7. <!-- build:js scripts/ng-map.min.js -->
  8. <script src="../app/scripts/app.js"></script>
  9. <script src="../app/scripts/directives/map_controller.js"></script>
  10. <script src="../app/scripts/directives/map.js"></script>
  11. <script src="../app/scripts/directives/marker.js"></script>
  12. <script src="../app/scripts/directives/shape.js"></script>
  13. <script src="../app/scripts/directives/info-window.js"></script>
  14. <script src="../app/scripts/services/geo_coder.js"></script>
  15. <script src="../app/scripts/services/navigator_geolocation.js"></script>
  16. <script src="../app/scripts/services/attr2_options.js"></script>
  17. <!-- endbuild -->
  18. <script>
  19. var app = angular.module('myApp', ['ngMap']);
  20. app.controller('IconComplexCtrl', function($scope) {
  21. $scope.image = {
  22. url: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
  23. size: [20, 32],
  24. origin: [0,0],
  25. anchor: [0, 32]
  26. };
  27. $scope.shape = {
  28. coords: [1, 1, 1, 20, 18, 20, 18 , 1],
  29. type: 'poly'
  30. };
  31. $scope.beaches = [
  32. ['Bondi Beach', -33.890542, 151.274856, 4],
  33. ['Coogee Beach', -33.923036, 151.259052, 5],
  34. ['Cronulla Beach', -34.028249, 151.157507, 3],
  35. ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
  36. ['Maroubra Beach', -33.950198, 151.259302, 1]
  37. ];
  38. });
  39. </script>
  40. </head>
  41. <body>
  42. <div ng-controller="IconComplexCtrl">
  43. <map zoom="10" center="-33.9, 151.2">
  44. <marker ng-repeat="beach in beaches"
  45. icon="{{image}}"
  46. shape="{{shape}}"
  47. title="{{beach[0]}}"
  48. position="{{beach[1]}}, {{beach[2]}}"
  49. z-index="{{beach[3]}}"></marker>
  50. </map>
  51. </div>
  52. </body>
  53. </html>