Commit 3226bb828117c7b75ef5492aeae1ade54a5395f7

Authored by Edmar Moretti
1 parent 5fb57828

Adaptação da ferramenta de cálculo de área para Bootstrap

ferramentas/area/dicionario.js
1 1 //+$trad(1,i3GEOF.area.dicionario)+
2 2 i3GEOF.area.dicionario = {
3   - 'ajuda' : [{
4   - pt : "",
  3 + 'incorporar' : [{
  4 + pt : "Incroporar figura ao mapa",
  5 + en : "",
  6 + es : ""
  7 + }],
  8 + 'inicia' : [{
  9 + pt : "Clique em diferentes pontos do mapa para traçar um polígono",
5 10 en : "",
6 11 es : ""
7 12 }]
... ...
ferramentas/area/index.js
... ... @@ -20,24 +20,22 @@ i3GEOF.area =
20 20 * Susbtitutos para o template
21 21 */
22 22 mustacheHash : function() {
23   -
  23 + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.area.dicionario);
  24 + dicionario["sid"] = i3GEO.configura.sid;
  25 + dicionario["locaplic"] = i3GEO.configura.locaplic;
  26 + return dicionario;
24 27 },
25 28 inicia : function(iddiv) {
  29 + if(i3GEOF.area.MUSTACHE == ""){
  30 + $.get(i3GEO.configura.locaplic + "/ferramentas/area/template_mst.html", function(template) {
  31 + i3GEOF.area.MUSTACHE = template;
  32 + i3GEOF.area.inicia(iddiv);
  33 + });
  34 + return;
  35 + }
26 36 i3GEO.eventos.cliquePerm.desativa();
27 37 $i(iddiv).innerHTML += i3GEOF.area.html();
28 38 i3GEOF.area[i3GEO.Interface["ATUAL"]].inicia();
29   - //
30   - // botao que abre a ferramenta de calculo de perfis.
31   - // pontosdistobj contem as coordenadas dos pontos
32   - //
33   - new YAHOO.widget.Button("i3GEObotaoAreaWkt", {
34   - onclick : {
35   - fn : function() {
36   - i3GEO.mapa.dialogo.wkt2layer(i3GEOF.area.ultimoWkt, i3GEOF.area.ultimaMedida);
37   - }
38   - }
39   - });
40   -
41 39 },
42 40 /*
43 41 * Function: html
... ... @@ -49,13 +47,7 @@ i3GEOF.area =
49 47 * String com o código html
50 48 */
51 49 html : function() {
52   - var ins = '<div class="bd" style="text-align:left;padding:3px;font-size:10px" >'
53   - // + '<label class=paragrafo style="float:left;top:5px;position:relative;">Estilo:</label>'
54   - // + '<div class=styled-select style="width:70px;">' + i3GEO.desenho.caixaEstilos() + '</div><br>'
55   - + '<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo" ></div>'
56   - + '<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo_parcial" ></div>'
57   - + '<br><input id=i3GEObotaoAreaWkt size="22" type="button" value="incorporar">'
58   - + '</div>';
  50 + var ins = Mustache.render(i3GEOF.area.MUSTACHE, i3GEOF.area.mustacheHash());
59 51 return ins;
60 52 },
61 53 /*
... ... @@ -72,12 +64,29 @@ i3GEOF.area =
72 64 minimiza = "";
73 65 // cria a janela flutuante
74 66 titulo =
75   - "</div>"
76   - + "<a class='i3GeoTituloJanelaBs' target=_blank href='"
  67 + "</div><a class='i3GeoTituloJanelaBs' target=_blank href='"
77 68 + i3GEO.configura.locaplic
78 69 + "/ajuda_usuario.php?idcategoria=6&idajuda=51' >"+$trad("areaAprox")+"</a>";
79 70 janela =
80   - i3GEO.janela.cria("220px", "auto", "", "", "", titulo, "i3GEOF.area", false, "hd", cabecalho, minimiza, "", true, "", "", "nao");
  71 + i3GEO.janela.cria(
  72 + "250px",
  73 + "auto",
  74 + "",
  75 + "",
  76 + "",
  77 + titulo,
  78 + "i3GEOF.area",
  79 + false,
  80 + "hd",
  81 + cabecalho,
  82 + minimiza,
  83 + "",
  84 + true,
  85 + "",
  86 + "",
  87 + "nao",
  88 + ""
  89 + );
81 90 divid = janela[2].id;
82 91 i3GEOF.area.inicia(divid);
83 92 temp =
... ... @@ -319,25 +328,22 @@ i3GEOF.area =
319 328 var mostra = $i("mostraarea_calculo"), texto;
320 329 if (mostra) {
321 330 texto =
322   - "<b>" + $trad("d21at")
323   - + ":</b> "
  331 + "total <br>" + $trad("d21at")
  332 + + " km2: "
324 333 + (area / 1000000).toFixed(3)
325   - + " km2"
326   - + "<br><b>"
  334 + + "<br>"
327 335 + $trad("d21at")
328   - + ":</b> "
  336 + + " ha: "
329 337 + (area / 10000).toFixed(2)
330   - + " ha"
331   - + "<br><b>"
  338 + + "<br>"
332 339 + $trad("x98")
333   - + ":</b> "
  340 + + " km: "
334 341 + (per).toFixed(2)
335   - + " km"
336 342 + "<br>"
337 343 + $trad("x25")
338 344 + ": "
339 345 + i3GEO.calculo.metododistancia;
340   - mostra.innerHTML = texto;
  346 + mostra.innerHTML = texto + "<hr>";
341 347 i3GEOF.area.ultimaMedida = (area / 1000000).toFixed(3) + " km2";
342 348 }
343 349 },
... ... @@ -348,28 +354,24 @@ i3GEOF.area =
348 354 var mostra = $i("mostraarea_calculo_parcial"), texto;
349 355 if (mostra) {
350 356 texto =
351   - "<b>" + $trad("d21at")
352   - + ":</b> "
  357 + "parcial <br>" + $trad("d21at")
  358 + + " km2:"
353 359 + (area / 1000000).toFixed(3)
354   - + " km2"
355   - + "<br><b>"
  360 + + "<br>"
356 361 + $trad("d21at")
357   - + ":</b> "
  362 + + " ha: "
358 363 + (area / 10000).toFixed(2)
359   - + " ha"
360   - + "<br><b>"
  364 + + "<br>"
361 365 + $trad("x95")
362   - + ":</b> "
  366 + + " km: "
363 367 + trecho.toFixed(3)
364   - + " km"
365   - + "<br><b>"
  368 + + "<br>"
366 369 + $trad("x98")
367   - + ":</b> "
  370 + + " km: "
368 371 + (per).toFixed(3)
369   - + " km"
370   - + "<br><b>"
  372 + + "<br>"
371 373 + $trad("x23")
372   - + " (DMS):</b> "
  374 + + " (DMS):"
373 375 + direcao;
374 376 mostra.innerHTML = texto;
375 377 }
... ... @@ -544,25 +546,22 @@ i3GEOF.area =
544 546 var mostra = $i("mostraarea_calculo"), texto;
545 547 if (mostra) {
546 548 texto =
547   - "<b>" + $trad("d21at")
548   - + ":</b> "
  549 + "total<br>" + $trad("d21at")
  550 + + " km2: "
549 551 + (area / 1000000).toFixed(3)
550   - + " km2"
551   - + "<br><b>"
  552 + + "<br>"
552 553 + $trad("d21at")
553   - + ":</b> "
  554 + + " ha: "
554 555 + (area / 10000).toFixed(2)
555   - + " ha"
556   - + "<br><b>"
  556 + + "<br>"
557 557 + $trad("x98")
558   - + ":</b> "
  558 + + " km: "
559 559 + (per).toFixed(2)
560   - + " km"
561 560 + "<br>"
562 561 + $trad("x25")
563 562 + ": "
564 563 + i3GEO.calculo.metododistancia;
565   - mostra.innerHTML = texto;
  564 + mostra.innerHTML = texto + "<hr>";
566 565 i3GEOF.area.ultimaMedida = (area / 1000000).toFixed(3) + " km2";
567 566 }
568 567 },
... ... @@ -573,28 +572,24 @@ i3GEOF.area =
573 572 var mostra = $i("mostraarea_calculo_parcial"), texto;
574 573 if (mostra) {
575 574 texto =
576   - "<b>" + $trad("d21at")
577   - + ":</b> "
  575 + "parcial<br>" + $trad("d21at")
  576 + + " km2: "
578 577 + (area / 1000000).toFixed(3)
579   - + " km2"
580   - + "<br><b>"
  578 + + "<br>"
581 579 + $trad("d21at")
582   - + ":</b> "
  580 + + " ha: "
583 581 + (area / 10000).toFixed(2)
584   - + " ha"
585   - + "<br><b>"
  582 + + "<br>"
586 583 + $trad("x95")
587   - + ":</b> "
  584 + + " km: "
588 585 + trecho.toFixed(3)
589   - + " km"
590   - + "<br><b>"
  586 + + "<br>"
591 587 + $trad("x98")
592   - + ":</b> "
  588 + + " km: "
593 589 + (per).toFixed(3)
594   - + " km"
595   - + "<br><b>"
  590 + + "<br>"
596 591 + $trad("x23")
597   - + " (DMS):</b> "
  592 + + " (DMS): "
598 593 + direcao;
599 594 mostra.innerHTML = texto;
600 595 }
... ...
ferramentas/area/template_mst.html
1   -<div></div>
2 1 \ No newline at end of file
  2 +<div class='container-fluid'>
  3 + <h5 class="alert alert-info">{{{inicia}}}</h5>
  4 + <div id="mostraarea_calculo"></div>
  5 + <div id="mostraarea_calculo_parcial"></div>
  6 + <button onclick="i3GEO.mapa.dialogo.wkt2layer(i3GEOF.area.ultimoWkt, i3GEOF.area.ultimaMedida);" class='btn btn-primary btn-sm btn-raised'>{{{incorporar}}}</button>
  7 +</div>
3 8 \ No newline at end of file
... ...