0

I have an app with Google Maps JavaScript API v3 in it, The map I have is on the bottom of my page and I want it to be on a different view so when I click on a link (Links are locations in this app) The app should take me to a different view with the map embedded in it. Here is my code for the map, how would I get this to run in a different view and redirect to it?

function initialize() {
      var mapOptions = {
        center: new google.maps.LatLng(site.Point.coordinates),
        zoom: 8
      };
      var map = new google.maps.Map(document.getElementById("map-canvas"),
        mapOptions);
    }
    google.maps.event.addDomListener(window, 'load', initialize)

Here is a plunk with my full code if you are interested in taking a look. http://plnkr.co/edit/OZZRgiEcrLzreW3lrc5v?p=preview

EDIT*** Doing this would probably be easiest using ng-route in Angular.js If anyone can give a brief explanation it would be greatly appreciated.

Ian Pennebaker
  • 233
  • 4
  • 15
  • Are you just asking how to add a route to an angular app? Also, you might want to check out angular ui's google map directive. – lucuma Jul 18 '14 at 14:58
  • Yeah, I forgot the name of that. Hold on i'm going to edit my question. But yes, I am asking how to route to another .HTML page using `ng-route` – Ian Pennebaker Jul 18 '14 at 15:01

0 Answers0