]> git.uio.no Git - u/erikhf/frm.git/commitdiff
[maps] removed markers
authorErik Haider Forsén <erikhf@ifi.uio.no>
Thu, 19 Nov 2015 19:50:49 +0000 (20:50 +0100)
committerErik Haider Forsén <erikhf@ifi.uio.no>
Thu, 19 Nov 2015 19:50:49 +0000 (20:50 +0100)
src/components/map/map.ts

index 91cc71488abaaaa41937eb73cf64a507bb32313b..a7264985f5d5b9cf20f908146b65722b68607f23 100644 (file)
@@ -13,7 +13,6 @@ import {Headers, Http} from 'angular2/http';
 export class Map {
 
     map:Object;
-    marker:Object;
     http: Http;
 
     constructor(http:Http) {
@@ -29,12 +28,11 @@ export class Map {
     init() {
 
         let initMap = this.initMap;
-        let addMarker = this.addMarker;
         let map = this.map;
         if (navigator.geolocation) {
             navigator.geolocation.getCurrentPosition(function (position) {
                     let pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
-                    initMap(pos,map,addMarker);
+                    initMap(pos,map);
                 }, function () {
                 //handleNoGeoLocation()
                 }
@@ -47,38 +45,19 @@ export class Map {
     }
 
 
-    initMap(location,map,addMarker){
+    initMap(location,map){
 
         map.setCenter(location,12);
-        addMarker(location,map,'This is YOU');
 
 
 
         map.addListener('click', function (event) {
-                addMarker(event.latLng,map, 'Want to add a new marker here ? <br> <button onclick=\"createOrgUnit()\">Yes</button> <button onclick=\"deleteMarker()">No</button> ');
+                console.log("jule husker");
             }
         );
 
     }
 
-    addMarker(location, map, title) {
-
-        let marker = new google.maps.Marker({
-            position: location,
-            map: map
-        });
-
-        let infowindow = new google.maps.InfoWindow({
-            content: title
-        });
-
-        marker.addListener('click', function () {
-            console.log(marker);
-            infowindow.open(map,marker);
-        });
-
-    }
-
     logError(error) {
         console.error(error);
 
@@ -171,10 +150,6 @@ export class Map {
         console.log('you just added a new organisation unit');
     }
 
-    deleteMarker(){
-        console.log('you just deleted the marker');
-    }
-
     update(event){
         this.newactive.next(event);
     }