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.