mapa parcelas

This commit is contained in:
abe- 2017-06-17 15:28:20 +02:00
parent c2f8f2e577
commit a15f1392b8

View file

@ -22,7 +22,7 @@ function preload() {
} }
function setup() { function setup() {
createCanvas(windowWidth,519); createCanvas(800,519);
nombres = new Array("Norte","Duero","Ebro","Pirineo","Jucar","Tajo","Guadiana","Guadalquivir","Sur", "Segura", "Baleares y Canarias"); nombres = new Array("Norte","Duero","Ebro","Pirineo","Jucar","Tajo","Guadiana","Guadalquivir","Sur", "Segura", "Baleares y Canarias");
colores = new Array("#f00","#0f0","#00f","#ff0","#0ff","#a00","#0a0","#00a","#aa0","#0aa", "#aaa"); colores = new Array("#f00","#0f0","#00f","#ff0","#0ff","#a00","#0a0","#00a","#aa0","#0aa", "#aaa");
x = new Array(158,243, 429, 597, 432, 268, 226, 253, 362,432, 611); x = new Array(158,243, 429, 597, 432, 268, 226, 253, 362,432, 611);
@ -31,9 +31,7 @@ function setup() {
function draw() { function draw() {
background(200,225,225); background(0,0);
var dx = (width-519)*.5;
translate(dx,0);
// capas // capas
for (var n = 0; n < ids.length; n++) { for (var n = 0; n < ids.length; n++) {
if (dimr[n] != -1) image(capas[n],0,0); if (dimr[n] != -1) image(capas[n],0,0);
@ -43,7 +41,7 @@ function draw() {
} }
// Parcelas segun PGC // Parcelas segun PGC
var mc = cmap.get(mouseX-dx,mouseY); var mc = cmap.get(mouseX,mouseY);
for (var n = 0; n < colores.length; n++) { for (var n = 0; n < colores.length; n++) {
if (compara(mc,color(colores[n]))) { if (compara(mc,color(colores[n]))) {
tint(255,100); tint(255,100);