mouse over mapPopUp on besoin & reponse
This commit is contained in:
parent
8806507ecb
commit
302252a1c1
@ -588,52 +588,6 @@ export default {
|
|||||||
|
|
||||||
this.ctx.stroke();
|
this.ctx.stroke();
|
||||||
},
|
},
|
||||||
drawEntites(){
|
|
||||||
// IF OPENED
|
|
||||||
if (this.opened) {
|
|
||||||
// place all entities points
|
|
||||||
// OR using entitées matter bodies
|
|
||||||
for (let i = 0; i < this.body.parts.length; i++) {
|
|
||||||
if (this.body.parts[i].item_type === 'entite'
|
|
||||||
// draw only entite agissante if map mode is action
|
|
||||||
&& ((this.map_mode === 'action' && this.body.parts[i].agissante) || this.map_mode !== "action")) {
|
|
||||||
let part = this.body.parts[i];
|
|
||||||
this.ctx.beginPath();
|
|
||||||
this.ctx.arc(part.position.x, part.position.y, 0.3*this.scale, 0, 2 * Math.PI, false);
|
|
||||||
// console.log(part.id, this.opened_entite_id);
|
|
||||||
if (part.id === this.opened_entite_id) {
|
|
||||||
this.ctx.fillStyle = "#F00";
|
|
||||||
} else {
|
|
||||||
this.ctx.fillStyle = "#000";
|
|
||||||
}
|
|
||||||
this.ctx.fill();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// IF CLOSED
|
|
||||||
else {
|
|
||||||
// map mode action
|
|
||||||
// if not opened and has_agissantes draw only entites agissantes
|
|
||||||
if (this.concernement.has_agissantes && this.map_mode === "action") {
|
|
||||||
for (let i = 0; i < this.body.parts.length; i++) {
|
|
||||||
if (this.body.parts[i].item_type === 'entite' && this.body.parts[i].agissante) {
|
|
||||||
let part = this.body.parts[i];
|
|
||||||
this.ctx.beginPath();
|
|
||||||
this.ctx.arc(part.position.x, part.position.y, 1*this.scale, 0, 2 * Math.PI, false);
|
|
||||||
// console.log(part.id, this.opened_entite_id);
|
|
||||||
if (part.id === this.opened_entite_id) {
|
|
||||||
this.ctx.fillStyle = "#F00";
|
|
||||||
} else {
|
|
||||||
this.ctx.fillStyle = "#000";
|
|
||||||
}
|
|
||||||
this.ctx.fill();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
drawBesoins(){
|
drawBesoins(){
|
||||||
for (let i = 0; i < this.body.parts.length; i++) {
|
for (let i = 0; i < this.body.parts.length; i++) {
|
||||||
if (this.body.parts[i].item_type === 'besoin' || this.body.parts[i].item_type === 'reponse') {
|
if (this.body.parts[i].item_type === 'besoin' || this.body.parts[i].item_type === 'reponse') {
|
||||||
@ -722,6 +676,52 @@ export default {
|
|||||||
|
|
||||||
this.ctx.stroke();
|
this.ctx.stroke();
|
||||||
},
|
},
|
||||||
|
drawEntites(){
|
||||||
|
// IF OPENED
|
||||||
|
if (this.opened) {
|
||||||
|
// place all entities points
|
||||||
|
// OR using entitées matter bodies
|
||||||
|
for (let i = 0; i < this.body.parts.length; i++) {
|
||||||
|
if (this.body.parts[i].item_type === 'entite'
|
||||||
|
// draw only entite agissante if map mode is action
|
||||||
|
&& ((this.map_mode === 'action' && this.body.parts[i].agissante) || this.map_mode !== "action")) {
|
||||||
|
let part = this.body.parts[i];
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.arc(part.position.x, part.position.y, 0.3*this.scale, 0, 2 * Math.PI, false);
|
||||||
|
// console.log(part.id, this.opened_entite_id);
|
||||||
|
if (part.id === this.opened_entite_id) {
|
||||||
|
this.ctx.fillStyle = "#F00";
|
||||||
|
} else {
|
||||||
|
this.ctx.fillStyle = "#000";
|
||||||
|
}
|
||||||
|
this.ctx.fill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// IF CLOSED
|
||||||
|
else {
|
||||||
|
// map mode action
|
||||||
|
// if not opened and has_agissantes draw only entites agissantes
|
||||||
|
if (this.concernement.has_agissantes && this.map_mode === "action") {
|
||||||
|
for (let i = 0; i < this.body.parts.length; i++) {
|
||||||
|
if (this.body.parts[i].item_type === 'entite' && this.body.parts[i].agissante) {
|
||||||
|
let part = this.body.parts[i];
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.arc(part.position.x, part.position.y, 1*this.scale, 0, 2 * Math.PI, false);
|
||||||
|
// console.log(part.id, this.opened_entite_id);
|
||||||
|
if (part.id === this.opened_entite_id) {
|
||||||
|
this.ctx.fillStyle = "#F00";
|
||||||
|
} else {
|
||||||
|
this.ctx.fillStyle = "#000";
|
||||||
|
}
|
||||||
|
this.ctx.fill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
drawContour(){
|
drawContour(){
|
||||||
if (this.salientPoints.length > 3) {
|
if (this.salientPoints.length > 3) {
|
||||||
var fillStyle;
|
var fillStyle;
|
||||||
|
@ -20,8 +20,12 @@ export default {
|
|||||||
// console.log(`popup created type: ${this.infos.type}`);
|
// console.log(`popup created type: ${this.infos.type}`);
|
||||||
if (this.infos.type === 'concernement') {
|
if (this.infos.type === 'concernement') {
|
||||||
this.concernement = this.concernementsByID[this.infos.id];
|
this.concernement = this.concernementsByID[this.infos.id];
|
||||||
} else {
|
} else if(this.infos.type === 'entite') {
|
||||||
this.entite = this.allEntitesById[this.infos.id];
|
this.entite = this.allEntitesById[this.infos.id];
|
||||||
|
} else if (this.infos.type === 'besoin') {
|
||||||
|
|
||||||
|
} else if (this.infos.type === 'reponse') {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@ -39,9 +43,13 @@ export default {
|
|||||||
handler (n, o){
|
handler (n, o){
|
||||||
if (n.type === 'concernement') {
|
if (n.type === 'concernement') {
|
||||||
this.concernement = this.concernementsByID[n.id];
|
this.concernement = this.concernementsByID[n.id];
|
||||||
} else {
|
} else if(n.type === 'entite') {
|
||||||
this.entite = this.allEntitesById[n.id];
|
this.entite = this.allEntitesById[this.infos.id];
|
||||||
}
|
} else if (n.type === 'besoin') {
|
||||||
|
|
||||||
|
} else if (n.type === 'reponse') {
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
@ -67,6 +75,12 @@ export default {
|
|||||||
<section v-if="infos.type === 'entite'" class="entite-map-popup">
|
<section v-if="infos.type === 'entite'" class="entite-map-popup">
|
||||||
<h1>{{ entite.entite.title }}</h1>
|
<h1>{{ entite.entite.title }}</h1>
|
||||||
</section>
|
</section>
|
||||||
|
<section v-if="infos.type === 'besoin'" class="besoin-map-popup">
|
||||||
|
<h1>Besoin</h1>
|
||||||
|
</section>
|
||||||
|
<section v-if="infos.type === 'reponse'" class="reponse-map-popup">
|
||||||
|
<h1>Réponse</h1>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -153,6 +153,21 @@ export default {
|
|||||||
id: body.id
|
id: body.id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (body.item_type === "besoin" // if it is a besoin
|
||||||
|
&& this.opened) { // if a concernement is opened
|
||||||
|
this.mapPopupData = {
|
||||||
|
type: 'besoin',
|
||||||
|
id: body.id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.item_type === "reponse" // if it is a besoin
|
||||||
|
&& this.opened) { // if a concernement is opened
|
||||||
|
this.mapPopupData = {
|
||||||
|
type: 'reponse',
|
||||||
|
id: body.id
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// console.log(`this.mapPopupData type: ${this.mapPopupData.type}, id: ${this.mapPopupData.id}`);
|
// console.log(`this.mapPopupData type: ${this.mapPopupData.type}, id: ${this.mapPopupData.id}`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user