UNPKG

ngmap

Version:
32 lines (30 loc) 944 B
<!DOCTYPE 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> var app = angular.module('myApp', ['ngMap']); app.controller('CustomControlCtrl', function(NgMap) { var vm = this; var chicago = new google.maps.LatLng(41.850033, -87.6500523); NgMap.getMap().then(function(map) { vm.map = map; }); vm.click = function() { vm.map.setCenter(chicago); }; }); </script> </head> <body ng-controller="CustomControlCtrl as vm"> Custom Control<br/> This custom control simply returns the user to Chicago when clicked <br/> <ng-map center="41.850033, -87.6500523" zoom="6" default-style="true"> <custom-control id="home" position="TOP_RIGHT" index="1" on-click="vm.click()"> <div style="background-color: black; color:#fff;cursor:pointer">Home1</div> </custom-control> </ng-map> </body> </html>