git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@46 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -23,7 +23,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
}
|
||||
},
|
||||
events: {
|
||||
//"click #goFbGroup": "goFbGroup"
|
||||
},
|
||||
|
||||
freeWall: null,
|
||||
@@ -132,9 +131,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
{
|
||||
var self = this;
|
||||
|
||||
$( window ).on( "orientationchange", function( event ) {
|
||||
});
|
||||
|
||||
self.setupFreeWall();
|
||||
|
||||
if (Profile.data.picture !== null)
|
||||
@@ -143,8 +139,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.
|
||||
}
|
||||
|
||||
Debug.writeMessage(myManifest.Agent.ua);
|
||||
//if (window.localStorage.getItem("goFbGroup") !== "1")
|
||||
// this.$el.find("#nuovoGruppo").popup("open");
|
||||
},
|
||||
onClosing: function () {
|
||||
if (this.freeWall !== null)
|
||||
|
||||
+53
-25
@@ -9,8 +9,13 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
template: _.template(mapsViewTemplate),
|
||||
infoWindowtemplate: _.template(infoWindowTemplate),
|
||||
defaultLatLng: new google.maps.LatLng(45.4654219, 9.1859243), // Default to Milan
|
||||
iconPM: {
|
||||
url: "http://app.gruppolapastamadre.it/icon.png",
|
||||
scaledSize: new google.maps.Size(24, 24)
|
||||
},
|
||||
initialize: function () {
|
||||
this.id = "MapsView";
|
||||
this.markers = [];
|
||||
MapsView.__super__.initialize.call(this);
|
||||
},
|
||||
_centerControl: function(controlDiv, map) {
|
||||
@@ -56,7 +61,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
_drawMap: function(LatLng){
|
||||
var self = this;
|
||||
@@ -75,7 +79,8 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
self.map = new google.maps.Map($("#map-canvas")[0], myOptions);
|
||||
|
||||
// Create the search box and link it to the UI element.
|
||||
var input = $("#pac-input")[0];
|
||||
var input = $('<input id="pac-input" data-role="none" class="controls" type="text" placeholder="Ricerca località..." style="display:none;">')[0];
|
||||
self.$el.find('div[data-role="content"]')[0].appendChild(input);
|
||||
var searchBox = new google.maps.places.SearchBox(input);
|
||||
self.map.controls[google.maps.ControlPosition.TOP_CENTER].push(input);
|
||||
var centerControlDiv = document.createElement('div');
|
||||
@@ -129,11 +134,6 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
self.map.fitBounds(bounds);
|
||||
});
|
||||
|
||||
var iconPM = {
|
||||
url: "http://app.gruppolapastamadre.it/icon.png",
|
||||
scaledSize: new google.maps.Size(24, 24)
|
||||
};
|
||||
|
||||
self.map.addListener('bounds_changed', function() {
|
||||
var bound = self.map.getBounds();
|
||||
searchBox.setBounds(bound);
|
||||
@@ -144,26 +144,18 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
//dataType: "json",
|
||||
//async: false,
|
||||
type: 'GET',
|
||||
success: function (resp) {
|
||||
success: function (resp) {
|
||||
resp.forEach(function(ele, index){
|
||||
if(!self.markers["|" + ele.Latitudine+ "|" + ele.Longitudine+ "|"])
|
||||
var key = "|" + ele.Latitudine+ "|" + ele.Longitudine+ "|";
|
||||
if(!self.markers[key])
|
||||
{
|
||||
var marker = new google.maps.Marker({
|
||||
position: new google.maps.LatLng(ele.Latitudine, ele.Longitudine),
|
||||
icon: iconPM,
|
||||
//label: ele.Name,
|
||||
title: ele.Name,
|
||||
map: self.map
|
||||
});
|
||||
self.markers["|" + ele.Latitudine+ "|" + ele.Longitudine+ "|"] = marker;
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: self.infoWindowtemplate({item: ele})
|
||||
});
|
||||
|
||||
marker.addListener('click', function() {
|
||||
infowindow.open(self.map, marker);
|
||||
});
|
||||
self._makeMarker(ele, key);
|
||||
}
|
||||
else if(!self.markers[key][ele.ID])
|
||||
{
|
||||
ele.Latitudine = parseFloat(ele.Latitudine) + (Math.random() / 500);
|
||||
ele.Longitudine = parseFloat(ele.Longitudine) + (Math.random() / 500);
|
||||
self._makeMarker(ele, key);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -171,7 +163,33 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
});
|
||||
$("#pac-input").show();
|
||||
},
|
||||
_makeMarker: function(ele,key){
|
||||
var self = this;
|
||||
var marker = new google.maps.Marker({
|
||||
position: new google.maps.LatLng(ele.Latitudine, ele.Longitudine),
|
||||
icon: self.iconPM,
|
||||
//label: ele.Name,
|
||||
title: ele.Name,
|
||||
map: self.map
|
||||
});
|
||||
|
||||
if(!self.markers[key])
|
||||
self.markers[key] = [];
|
||||
|
||||
self.markers[key][ele.ID] = marker;
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: self.infoWindowtemplate({item: ele})
|
||||
});
|
||||
|
||||
marker.addListener('click', function() {
|
||||
infowindow.open(self.map, marker);
|
||||
});
|
||||
},
|
||||
onShowed: function(){
|
||||
if(this.map)
|
||||
return;
|
||||
|
||||
var self = this;
|
||||
|
||||
$( window ).resize( function(){
|
||||
@@ -193,6 +211,16 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/maps/mapsViewTemplate.
|
||||
self._drawMap(self.defaultLatLng); // No geolocation support, show default map
|
||||
}
|
||||
},
|
||||
onClosing: function(){
|
||||
var self = this;
|
||||
Object.keys(self.markers).forEach(function(key, i){
|
||||
Object.keys(self.markers[key]).forEach(function(ID, k){
|
||||
self.markers[key][ID].setMap(null);
|
||||
});
|
||||
});
|
||||
|
||||
self.markers = [];
|
||||
},
|
||||
//render the content into div of view
|
||||
render: function () {
|
||||
if (this.created === true)
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
<div id="searchPanel">
|
||||
<h3>Mappa Spacciatori</h3>
|
||||
</div>
|
||||
<input id="pac-input" data-role="none" class="controls" type="text" placeholder="Ricerca località..." style="display:none;">
|
||||
<div id="map-canvas">
|
||||
<!-- map loads here... -->
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,8 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
Profile.data.dataSpacc.cap === "" ||
|
||||
Profile.data.dataSpacc.tipopm === "")
|
||||
{
|
||||
this.$el.find('#messaggio').html("<center><h1>ATTENZIONE</h1> devono essere settate tutte i campi</center>");
|
||||
self.$el.find('#titlePopup').html("Campi obbligatori");
|
||||
this.$el.find('#messaggio').html("<center><h1 style='color: red;'>ATTENZIONE</h1> devono essere settate tutte i campi</center>");
|
||||
this.$el.find('#popupDialog').popup("open");
|
||||
self._flagSave = false;
|
||||
return;
|
||||
@@ -54,7 +55,8 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
|
||||
if(Profile.data.dataSpacc.privacy==="0")
|
||||
{
|
||||
this.$el.find('#messaggio').html("<center><h1>ATTENZIONE</h1> per proseguire si DEVE accettare l'informativa privacy</center>");
|
||||
self.$el.find('#titlePopup').html("Informativa privacy");
|
||||
this.$el.find('#messaggio').html("<center><h1 style='color: red;'>ATTENZIONE</h1> per proseguire è obbligatorio accettare l'informativa privacy</center>");
|
||||
this.$el.find('#popupDialog').popup("open");
|
||||
self._flagSave = false;
|
||||
return;
|
||||
@@ -72,8 +74,10 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
Profile.data.dataSpacc.lat = response.results[0].geometry.location.lat;
|
||||
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
||||
Profile.updateProfile(function(){
|
||||
self._flagSave = false;
|
||||
Backbone.history.loadUrl(Backbone.history.getFragment());
|
||||
self._flagSave = false;
|
||||
self.$el.find('#titlePopup').html("Salvataggio");
|
||||
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
||||
self.$el.find('#popupDialog').popup("open");
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -83,7 +87,10 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
{
|
||||
Profile.updateProfile(function(){
|
||||
self._flagSave = false;
|
||||
Backbone.history.loadUrl(Backbone.history.getFragment());
|
||||
self.$el.find('#titlePopup').html("Salvataggio");
|
||||
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
||||
self.$el.find('#popupDialog').popup("open");
|
||||
//Backbone.history.loadUrl(Backbone.history.getFragment());
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -169,7 +169,7 @@ segnalazione inoltrata.</label>
|
||||
</div>
|
||||
<div data-role="popup" id="popupDialog">
|
||||
<div data-role="header">
|
||||
<h1>Avvertimento</h1>
|
||||
<h3 id="titlePopup"></h3>
|
||||
</div>
|
||||
<div role="main" class="ui-content">
|
||||
<p id="messaggio" style="text-align: center;font-style: italic;">
|
||||
|
||||
Reference in New Issue
Block a user