marker_with_dynamic_position.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!DOCTYPE html>
  2. <html ng-app="ngMap">
  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.5/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. function MyCtrl($scope) {
  20. $scope.lat = 40.74, $scope.lng = -74.18;
  21. };
  22. </script>
  23. </head>
  24. <body>
  25. <div ng-controller="MyCtrl">
  26. <map zoom="11" center="[{{lat}}, {{lng}}]" style="width:600px; height:400px">
  27. <marker position="[{{lat}}, {{lng}}]" title="{{lat}}, {{lng}}"></marker>
  28. </map>
  29. <br/>Latigude : <input type="number" ng-model="lat" />
  30. <br/>Longitude : <input type="number" ng-model="lng" />
  31. </div>
  32. </body>
  33. </html>