infowindow_ng_click.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!doctype html>
  2. <html ng-app="myapp">
  3. <head>
  4. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=weather,visualization,panoramio"></script>
  5. <script src="https://code.angularjs.org/1.2.25/angular.js"></script>
  6. <!-- build:js scripts/ng-map.min.js -->
  7. <script src="../app/scripts/app.js"></script>
  8. <script src="../app/scripts/directives/map_controller.js"></script>
  9. <script src="../app/scripts/directives/map.js"></script>
  10. <script src="../app/scripts/directives/marker.js"></script>
  11. <script src="../app/scripts/directives/shape.js"></script>
  12. <script src="../app/scripts/directives/info-window.js"></script>
  13. <script src="../app/scripts/services/geo_coder.js"></script>
  14. <script src="../app/scripts/services/navigator_geolocation.js"></script>
  15. <script src="../app/scripts/services/attr2_options.js"></script>
  16. <!-- endbuild -->
  17. <script>
  18. var app = app || angular.module('myapp', ['ngMap']);
  19. app.controller('MyCtrl', function($scope) {
  20. $scope.clicked = function() {
  21. alert('Clicked a link inside infoWindow');
  22. };
  23. });
  24. </script>
  25. </head>
  26. <body>
  27. <div ng-controller="MyCtrl">
  28. <map center="41,-87" zoom="3">
  29. <marker position="41, -87" on-click="showInfoWindow('foo')"></marker>
  30. <info-window id="foo">
  31. <div ng-non-bindable="">
  32. Lat/Lng: {{this.getPosition()}}<br/>
  33. <a href="#" ng-click="clicked()">Click Here</a>
  34. </div>
  35. </info-window>
  36. </map>
  37. </div>
  38. </body>
  39. </html>