Template:Team:Aachen/MeetupMap1.js

From 2014.igem.org

(Difference between revisions)
 
(9 intermediate revisions not shown)
Line 1: Line 1:
-
        var map, layer;
+
function initialize() {
 +
  var llcouven = new google.maps.LatLng(50.776525,6.07854);
 +
  var ll13 = new google.maps.LatLng(50.777488,6.078368);
 +
  var ll3 = new google.maps.LatLng(50.779944,6.075279);
 +
  var llx3 = new google.maps.LatLng(50.779415,6.081802);
 +
var llcenter = new google.maps.LatLng(50.778899,6.078283);
-
        function init(){
+
  var mapOptions = {
-
     map = new OpenLayers.Map("map");
+
     zoom: 16,
-
    map.addLayer(new OpenLayers.Layer.OSM());
+
    center: llcenter
-
+
  }
-
    var lonLat = new OpenLayers.LonLat( -0.1279688 ,51.5077286 )
+
  var map = new google.maps.Map(document.getElementById('map-couvenhalle'), mapOptions);
-
          .transform(
+
 
-
            new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
+
  var marker_couvenhalle = new google.maps.Marker({
-
            map.getProjectionObject() // to Spherical Mercator Projection
+
      position: llcouven,
-
          );
+
      map: map,
-
+
      title: 'Couvenhalle'
-
    var zoom=16;
+
  });
-
+
 
-
    var markers = new OpenLayers.Layer.Markers( "Markers" );
+
  var marker_bus13 = new google.maps.Marker({
-
     map.addLayer(markers);
+
      position: ll13,
-
+
      map: map,
-
    markers.addMarker(new OpenLayers.Marker(lonLat));
+
      title: 'Bus Stop: Technische Hochschule'
-
+
  });
-
     map.setCenter (lonLat, zoom);
+
 
-
        }
+
  var marker_bus3 = new google.maps.Marker({
 +
      position: ll3,
 +
      map: map,
 +
      title: 'Bus Stop: Audimax'
 +
  });
 +
 
 +
  var marker_busx3 = new google.maps.Marker({
 +
      position: llx3,
 +
      map: map,
 +
      title: 'Bus Stop: Driescher Gässchen'
 +
  });
 +
 
 +
 
 +
var iwcouven = new google.maps.InfoWindow({
 +
      content: 'Couvenhalle'
 +
  });
 +
 
 +
var iw13 = new google.maps.InfoWindow({
 +
      content: 'Bus Stop: Technische Hochschule'
 +
  });
 +
 
 +
var iw3 = new google.maps.InfoWindow({
 +
      content: 'Bus Stop: Audimax'
 +
  });
 +
 
 +
var iwx3 = new google.maps.InfoWindow({
 +
      content: 'Bus Stop: Driescher Gässchen'
 +
  });
 +
 
 +
  google.maps.event.addListener(marker_couvenhalle, 'click', function() {
 +
     iwcouven.open(map,marker_couvenhalle);
 +
  });
 +
  google.maps.event.addListener(marker_bus13, 'click', function() {
 +
    iw13.open(map,marker_bus13);
 +
  });
 +
  google.maps.event.addListener(marker_bus3, 'click', function() {
 +
     iw3.open(map,marker_bus3);
 +
  });
 +
  google.maps.event.addListener(marker_busx3, 'click', function() {
 +
    iwx3.open(map,marker_busx3);
 +
  });
 +
 
 +
}
 +
 
 +
google.maps.event.addDomListener(window, 'load', initialize);

Latest revision as of 21:27, 5 September 2014

function initialize() {

 var llcouven = new google.maps.LatLng(50.776525,6.07854);
 var ll13 = new google.maps.LatLng(50.777488,6.078368);
 var ll3 = new google.maps.LatLng(50.779944,6.075279);
 var llx3 = new google.maps.LatLng(50.779415,6.081802);

var llcenter = new google.maps.LatLng(50.778899,6.078283);

 var mapOptions = {
   zoom: 16,
   center: llcenter
 }
 var map = new google.maps.Map(document.getElementById('map-couvenhalle'), mapOptions);
 var marker_couvenhalle = new google.maps.Marker({
     position: llcouven,
     map: map,
     title: 'Couvenhalle'
 });
 var marker_bus13 = new google.maps.Marker({
     position: ll13,
     map: map,
     title: 'Bus Stop: Technische Hochschule'
 });
 var marker_bus3 = new google.maps.Marker({
     position: ll3,
     map: map,
     title: 'Bus Stop: Audimax'
 });
 var marker_busx3 = new google.maps.Marker({
     position: llx3,
     map: map,
     title: 'Bus Stop: Driescher Gässchen'
 });


var iwcouven = new google.maps.InfoWindow({

     content: 'Couvenhalle'
 });

var iw13 = new google.maps.InfoWindow({

     content: 'Bus Stop: Technische Hochschule'
 });

var iw3 = new google.maps.InfoWindow({

     content: 'Bus Stop: Audimax'
 });

var iwx3 = new google.maps.InfoWindow({

     content: 'Bus Stop: Driescher Gässchen'
 });
 google.maps.event.addListener(marker_couvenhalle, 'click', function() {
   iwcouven.open(map,marker_couvenhalle);
 });
 google.maps.event.addListener(marker_bus13, 'click', function() {
   iw13.open(map,marker_bus13);
 });
 google.maps.event.addListener(marker_bus3, 'click', function() {
   iw3.open(map,marker_bus3);
 });
 google.maps.event.addListener(marker_busx3, 'click', function() {
   iwx3.open(map,marker_busx3);
 });

}

google.maps.event.addDomListener(window, 'load', initialize);