Commit 59cdc229 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Stub image for side feature panel (closes #33)

parent 76ce2887
......@@ -60,9 +60,10 @@ Feature.prototype.get = function() {
/*
* Images
*/
var pictures = $("<div class=\"side-content-feature-pictures\"></div>");
if(this._feature.hasImages() || this._mapillary.length > 0) {
this._pictureId = 0;
var pictures = $("<div class=\"side-content-feature-pictures\"></div>");
//Prev / next buttons
if(this._feature.getImages().count() + this._mapillary.length > 1) {
......@@ -90,8 +91,12 @@ Feature.prototype.get = function() {
}
pictures.find(".side-content-feature-picture:first").show();
element.append(pictures);
}
//Stub image
else {
pictures.append("<div class=\"side-content-feature-picture basic\"><img src=\"img/stub_feature.jpg\" alt=\"Loading image...\" /></div>");
}
element.append(pictures);
/*
* Details
......
......@@ -6,15 +6,64 @@ var $ = require("jquery");
var L = require("leaflet");
var OLU = require("../src/OLU");
var config = null;
//Load config file
$.ajax({
url: 'conf/config.json',
async: false,
dataType: 'json',
success: function(data) { config = data; }
}).fail(function() { throw new Error("[Controller] Error while retrieving CONFIG"); });
var ftDetails = {
"details": {
"major": {
"opening_hours": {
"type": "hours",
"img": "clock",
"name": "Opening hours"
},
"contact:website": {
"type": "link",
"img": "web",
"name": "Website"
},
"website": {
"type": "link",
"img": "web",
"name": "Website"
},
"contact:email": {
"type": "email",
"img": "email",
"name": "E-mail"
},
"email": {
"type": "email",
"img": "email",
"name": "E-mail"
},
"contact:phone": {
"type": "text",
"img": "phone",
"name": "Phone"
},
"phone": {
"type": "text",
"img": "phone",
"name": "Phone"
},
"wheelchair": {
"type": "text_bind",
"img": "wheelchair",
"text_bind": { "yes": "Fully accessible", "limited": "Limited access", "no": "Not accessible" }
}
},
"minor": {
"cuisine": {
"type": "text",
"img": "cuisine",
"name": "Cuisine"
},
"description": {
"type": "text",
"img": "info",
"name": "More details"
}
}
}
};
var map = L.map('map').setView([48.11, -1.67], 13);
var OpenStreetMap_Mapnik = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
......@@ -35,10 +84,10 @@ var f = new OLU.model.Feature({
"email": "panier@avide.com",
"contact:email": "lalala@.com",
"level": "0",
"image": "https://upload.wikimedia.org/wikipedia/commons/a/ac/Jean_Loyer_Vue_de_Rennes.jpg",
"mapillary": "vXUuIbaTJsPjcOe1mXJnyg",
"mapillary:N": "Eh0yub0CP_IMlfkKMBFE_Q",
"wikimedia_commons": "File:Beachwave Beachwear, Cocoa Beach.JPG",
//"image": "https://upload.wikimedia.org/wikipedia/commons/a/ac/Jean_Loyer_Vue_de_Rennes.jpg",
//"mapillary": "vXUuIbaTJsPjcOe1mXJnyg",
//"mapillary:N": "Eh0yub0CP_IMlfkKMBFE_Q",
//"wikimedia_commons": "File:Beachwave Beachwear, Cocoa Beach.JPG",
"wheelchair": "limited"
}, "meta": {}, "relations": [] },
"geometry": { "type": "Point", "coordinates": [-1.704077,48.1210744] }
......@@ -46,5 +95,5 @@ var f = new OLU.model.Feature({
//Tests
var side = OLU.view.side("side").addTo(map);
side.contents.feature.set(f, config.feature.details, { iconFolder: config.map.iconFolder, mapillaryClient: config.api.mapillary.clientId, showTags: true });
side.contents.feature.set(f, ftDetails, { iconFolder: "img", mapillaryClient: "eDhQTTdnRmZJNXdYZWUwRDQxc1NwdzpmYjE3YWE3MWM5ZjcyMTdm", showTags: true });
side.show("feature");
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