Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Created May 7, 2013 19:11
Show Gist options
  • Save mustmodify/5535266 to your computer and use it in GitHub Desktop.
Save mustmodify/5535266 to your computer and use it in GitHub Desktop.
diff 6913900c418
commit 6913900c41860734a1cb1b7d241393213b28c59b
Author: Johnathon E. Wright <jw@mustmodify.com>
Date: Tue May 7 12:09:27 2013 -0700
diff --git a/app.js b/app.js
index 0de46e8..5d0eb14 100644
--- a/app.js
+++ b/app.js
@@ -3,6 +3,24 @@ var app = angular.module('map-app', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
+
+ $scope.draw_map = function()
+ {
+ var options={
+ elt:document.getElementById('map'), /*ID of element on the page where you want the map added*/
+ zoom:13, /*initial zoom level of the map*/
+ latLng:{lat:40.735383, lng:-73.984655}, /*center of map in latitude/longitude */
+ mtype:'osm', /*map type (osm)*/
+ bestFitMargin:0, /*margin offset from the map viewport when applying a bestfit on shapes*/
+ zoomOnDoubleClick:true /*zoom in when double-clicking on map*/
+ };
+
+ window.map = new MQA.TileMap(options);
+ };
+
+ $scope.$on('$routeChangeSuccess', function(next, current) {
+ $scope.draw_map();
+ });
});
app.config(['$routeProvider', function($routeProvider) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment