Commit 2e32bf95 authored by Dominik Rosiek's avatar Dominik Rosiek

usuwanie linkóœ

parent 590511d8
......@@ -38,13 +38,21 @@ Map.prototype.addMarker = function(data){
icon: image,
title: data.title,
beacon: data.beacon
}).addListener('click', function() {
})
marker.addListener('click', function() {
self.showInfo(this.beacon)
})
self.markers.push(marker)
}
Map.prototype.clearMarkers = function(){
for(var i=0; i<this.markers.length; i++){
this.markers[i].setMap(null);
}
}
Map.prototype.getAllBeacons = function(){
var self = this;
$.getJSON("/api/user_project/" + project_id + "/beacons", function(data){
......@@ -68,6 +76,7 @@ Map.prototype.getAllBeacons = function(){
}
Map.prototype.showInfo = function(beacon){
var self = true;
$("#myModalLabel").text([beacon.name, " (", beacon.uuid, ")"].join(""))
$("#modal-content").html([
'<div class="col-md-6">',
......@@ -126,7 +135,9 @@ Map.prototype.showInfo = function(beacon){
data: JSON.stringify(data),
contentType: "application/json",
success: function(result) {
alert(JSON.stringify(result))
map.clearMarkers();
map.getAllBeacons();
$("#myModal").modal("hide");
}
});
......@@ -143,7 +154,9 @@ Map.prototype.showInfo = function(beacon){
data: JSON.stringify(data),
contentType: "application/json",
success: function(result) {
alert(JSON.stringify(result))
map.clearMarkers();
map.getAllBeacons();
$("#myModal").modal("hide");
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment