marker-animations.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.min.js"></script>
  7. <script src="scripts/app.js"></script>
  8. <!-- build:js scripts/ng-map.min.js -->
  9. <script src="../app/scripts/app.js"></script>
  10. <script src="../app/scripts/directives/map_controller.js"></script>
  11. <script src="../app/scripts/directives/map.js"></script>
  12. <script src="../app/scripts/directives/marker.js"></script>
  13. <script src="../app/scripts/directives/shape.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('MarkerAnimationCtrl', function($scope) {
  21. $scope.toggleBounce = function() {
  22. if (this.getAnimation() != null) {
  23. this.setAnimation(null);
  24. } else {
  25. this.setAnimation(google.maps.Animation.BOUNCE);
  26. }
  27. }
  28. });
  29. </script>
  30. </head>
  31. <body>
  32. Marker Animations<br/>
  33. The following example creates a marker in Stockholm, Sweden
  34. using a DROP animation. Clicking on the marker will toggle
  35. the animation between a BOUNCE animation and no animation.
  36. <div ng-controller="MarkerAnimationCtrl">
  37. <map center="59.32522, 18.07002" zoom="13">
  38. <marker position="59.327383, 18.06747"
  39. on-click="toggleBounce()"
  40. animation="DROP"
  41. draggable="true"></marker>
  42. </map>
  43. </div>
  44. </body>
  45. </html>