ngmap
Version:
The Simplest AngularJS Google Maps V3 Directive
33 lines (30 loc) • 1.04 kB
HTML
<html ng-app="myApp">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script src="script-tags-for-development.js"></script>
<script src="USGSOverlay.js"></script>
<script>
var app = angular.module('myApp', ['ngMap']);
app.controller('GroundoverlayCustomCtrl', function(NgMap) {
var vm = this;
vm.overlay;
NgMap.getMap().then(function(map) {
vm.map = map;
var swBound = new google.maps.LatLng(62.281819, -150.287132);
var neBound = new google.maps.LatLng(62.400471, -150.005608);
var bounds = new google.maps.LatLngBounds(swBound, neBound);
var srcImage = 'https://developers.google.com/maps/documentation/javascript/';
srcImage += 'examples/full/images/talkeetna.png';
vm.overlay = new USGSOverlay(bounds, srcImage, map);
});
});
</script>
</head>
<body>
<div ng-controller="GroundoverlayCustomCtrl as vm">
<ng-map zoom="11" center="62.323907, -150.109291" map-type-id="SATELLITE">
</ng-map>
</div>
</body>
</html>