fix initial state of map photo layer
This commit is contained in:
Родитель
d590aa0373
Коммит
f8be670bb3
|
@ -6,18 +6,21 @@ function PhotosController () {
|
|||
|
||||
PhotosController.prototype = {
|
||||
|
||||
appendToMap : function(map) {
|
||||
initLayer : function(map) {
|
||||
this.map = map;
|
||||
this.photoLayer = L.markerClusterGroup({
|
||||
iconCreateFunction : this.getClusterIconCreateFunction(),
|
||||
showCoverageOnHover : false,
|
||||
maxClusterRadius: this.PHOTO_MARKER_VIEW_SIZE + 10,
|
||||
icon: {
|
||||
icon: {
|
||||
iconSize: [this.PHOTO_MARKER_VIEW_SIZE, this.PHOTO_MARKER_VIEW_SIZE]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.photoLayer.on('click', this.getPhotoMarkerOnClickFunction());
|
||||
this.photoLayer.addTo(this.map);
|
||||
var that = this;
|
||||
$('#navigation-photos').click(function() {
|
||||
that.toggleLayer();
|
||||
});
|
||||
},
|
||||
|
||||
showLayer: function() {
|
||||
|
@ -144,7 +147,7 @@ PhotosController.prototype = {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/* Preview size 32x32 is used in files view, so it sould be generated */
|
||||
generateThumbnailUrl: function (filename) {
|
||||
return OC.generateUrl('core') + '/preview.png?file=' + encodeURI(filename) + '&x=32&y=32';
|
||||
|
|
32
js/script.js
32
js/script.js
|
@ -2,10 +2,8 @@
|
|||
$(function() {
|
||||
//Photos
|
||||
mapController.initMap();
|
||||
photosController.appendToMap(mapController.map);
|
||||
$('#navigation-photos').click(function() {
|
||||
photosController.toggleLayer();
|
||||
});
|
||||
photosController.initLayer(mapController.map);
|
||||
photosController.showLayer();
|
||||
|
||||
// Popup
|
||||
$(document).on('click', '#opening-hours-header', function() {
|
||||
|
@ -166,19 +164,19 @@
|
|||
}
|
||||
};
|
||||
|
||||
var url = OC.generateUrl('/apps/maps/favorites');
|
||||
var type = 'GET';
|
||||
$.ajax({
|
||||
type: type,
|
||||
url: url,
|
||||
data: {},
|
||||
async: true,
|
||||
}).done(function (response) {
|
||||
console.log(response);
|
||||
}).always(function() {
|
||||
}).fail(function() {
|
||||
OC.Notification.showTemporary(t('maps', 'Failed to get favorites'));
|
||||
});
|
||||
//var url = OC.generateUrl('/apps/maps/favorites');
|
||||
//var type = 'GET';
|
||||
//$.ajax({
|
||||
// type: type,
|
||||
// url: url,
|
||||
// data: {},
|
||||
// async: true,
|
||||
//}).done(function (response) {
|
||||
// console.log(response);
|
||||
//}).always(function() {
|
||||
//}).fail(function() {
|
||||
// OC.Notification.showTemporary(t('maps', 'Failed to get favorites'));
|
||||
//});
|
||||
|
||||
//url = OC.generateUrl('/apps/maps/api/1.0/favorites');
|
||||
//type = 'GET';
|
||||
|
|
Загрузка…
Ссылка в новой задаче