Commit fe535ac61bf1a51ca92b1ee48f04972675f33fb4

Authored by Edmar Moretti
1 parent f6c0b04a

--no commit message

admin/admin.db
No preview for this file type
ferramentas/storymap/default.php
... ... @@ -52,6 +52,9 @@ html, body {
52 52 padding: 0px;
53 53 margin: 0px;
54 54 }
  55 +.vco-map-line{
  56 + display: none
  57 +}
55 58 </style>
56 59  
57 60 </head>
... ... @@ -60,8 +63,24 @@ html, body {
60 63 <!-- JavaScript-->
61 64 <script src="../../pacotes/knightlab/StoryMapJS/compiled/js/storymap.js"></script>
62 65 <script>
  66 + VCO.Language = {
  67 + name: "Português",
  68 + lang: "pt",
  69 + messages: {
  70 + loading: "carregando",
  71 + wikipedia: "da Wikipedia, a enciclopédia livre",
  72 + start: "Explore"
  73 + },
  74 + buttons: {
  75 + map_overview: "vista geral do mapa",
  76 + overview: "vista geral",
  77 + backtostart: "voltar ao começo",
  78 + collapse_toggle: "ocultar o mapa",
  79 + uncollapse_toggle: "mostrar o mapa"
  80 + }
  81 +};
63 82 var storymap = new VCO.StoryMap('storymap', '../../json.php?tema=<?php echo strip_tags($_GET["tema"]);?>&format=storymap&', {
64   - show_lines: false
  83 + "show_lines": false
65 84 });
66 85 window.onresize = function(event) {
67 86 storymap.updateDisplay();
... ...
ferramentas/storymap/index.js
... ... @@ -139,7 +139,6 @@ i3GEOF.storymap =
139 139 combo(r.data.valores, "i3GEOstocolcabecalho");
140 140 combo(r.data.valores, "i3GEOstocoltexto");
141 141 combo(r.data.valores, "i3GEOstocollocal");
142   - combo(r.data.valores, "i3GEOstocolicone");
143 142 combo(r.data.valores, "i3GEOstocolmedia");
144 143 combo(r.data.valores, "i3GEOstocollon");
145 144 combo(r.data.valores, "i3GEOstocollat");
... ... @@ -150,7 +149,6 @@ i3GEOF.storymap =
150 149 $i("i3GEOstocolcabecalhoCombo").value = camada.ferramentas.storymap.colcabecalho;
151 150 $i("i3GEOstocoltextoCombo").value = camada.ferramentas.storymap.coltexto;
152 151 $i("i3GEOstocollocalCombo").value = camada.ferramentas.storymap.collocal;
153   - $i("i3GEOstocoliconeCombo").value = camada.ferramentas.storymap.colicone;
154 152 $i("i3GEOstocolmediaCombo").value = camada.ferramentas.storymap.colmedia;
155 153 $i("i3GEOstocollonCombo").value = camada.ferramentas.storymap.collon;
156 154 $i("i3GEOstocollatCombo").value = camada.ferramentas.storymap.collat;
... ... @@ -264,8 +262,6 @@ i3GEOF.storymap =
264 262 + $i("i3GEOstocoltextoCombo").value
265 263 + '","collocal":"'
266 264 + $i("i3GEOstocollocalCombo").value
267   - + '","colicone":"'
268   - + $i("i3GEOstocoliconeCombo").value
269 265 + '","colmedia":"'
270 266 + $i("i3GEOstocolmediaCombo").value
271 267 + '","collon":"'
... ...
ferramentas/storymap/template_mst.html
... ... @@ -18,9 +18,6 @@
18 18 <p class='paragrafo'>{{{collocal}}}</p>
19 19 <div class='styled-select' id='i3GEOstocollocal'></div>
20 20 <br>
21   -<p class='paragrafo'>{{{colicone}}}</p>
22   -<div class='styled-select' id='i3GEOstocolicone'></div>
23   -<br>
24 21 <p class='paragrafo'>{{{colmedia}}}</p>
25 22 <div class='styled-select' id='i3GEOstocolmedia'></div>
26 23 <br>
... ...
js/interface.js
... ... @@ -1298,11 +1298,6 @@ i3GEO.Interface =
1298 1298 i3GEO.pluginI3geo.inicia(camada);
1299 1299 continue;
1300 1300 } else {
1301   - if (camada.cache) {
1302   - urllayer = url + "&cache=" + camada.cache + "&layer=" + camada.name + "&r=" + Math.random();
1303   - } else {
1304   - urllayer = url + "&cache=&layer=" + camada.name + "&r=" + Math.random();
1305   - }
1306 1301 try {
1307 1302 // Layer types do mapserver
1308 1303 // MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON,
... ... @@ -1311,7 +1306,6 @@ i3GEO.Interface =
1311 1306 // MS_LAYER_TILEINDEX, MS_LAYER_CHART
1312 1307 // temp = camada.type === 0 ? opcoes.gutter = 20 : opcoes.gutter = 0;
1313 1308 temp = camada.transitioneffect === "nao" ? opcoes.preload = 0 : opcoes.preload = Infinity;
1314   -
1315 1309 //
1316 1310 // layers marcados com o metadata wmstile com valor
1317 1311 // 1 sao inseridos com Layer.TileCache
... ... @@ -1361,6 +1355,13 @@ i3GEO.Interface =
1361 1355 if (camada.tiles === "sim" || camada.cache === "sim" || (camada.cortepixels && camada.cortepixels > 0)) {
1362 1356 opcoes.singleTile = false;
1363 1357 }
  1358 +
  1359 + if (camada.cache) {
  1360 + urllayer = url + "&cache=" + camada.cache;
  1361 + } else {
  1362 + urllayer = url + "&cache=nao";
  1363 + }
  1364 + urllayer += "&layer=" + camada.name;
1364 1365 if (opcoes.singleTile === true) {
1365 1366 source = new ol.source.ImageWMS({
1366 1367 url : urllayer,
... ... @@ -1370,6 +1371,7 @@ i3GEO.Interface =
1370 1371 },
1371 1372 projection : opcoes.projection
1372 1373 });
  1374 + source.set("tipoServico", "ImageWMS");
1373 1375 } else {
1374 1376 source = new ol.source.WMTS({
1375 1377 url : urllayer,
... ... @@ -1383,6 +1385,7 @@ i3GEO.Interface =
1383 1385 }),
1384 1386 wrapX : true
1385 1387 });
  1388 + source.set("tipoServico", "WMTS");
1386 1389 }
1387 1390 source.set("name", camada.name);
1388 1391 opcoes.source = source;
... ... @@ -1617,21 +1620,32 @@ i3GEO.Interface =
1617 1620 * Atualiza o mapa atual, forcando o redesenho dos layers
1618 1621 */
1619 1622 atualizaMapa : function() {
1620   - var layers = i3geoOL.layers, nlayers = layers.length, i;
  1623 + var layer, layers = i3geoOL.layers, nlayers = layers.length, i, servico, source;
1621 1624 for (i = 0; i < nlayers; i++) {
1622   - if (layers[i].url) {
1623   - layers[i].mergeNewParams({
1624   - r : Math.random()
1625   - });
1626   - if (layers[i].url.search("\\?") >= 0) {
1627   - layers[i].url = layers[i].url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&", "&foo=");
1628   - layers[i].url = layers[i].url + "&&";
  1625 + layer = layers[i];
  1626 + if (layer && layer != undefined) {
  1627 + source = layer.getSource();
  1628 + servico = source.getProperties().tipoServico;
  1629 + if(servico === "WMTS"){
  1630 + funcaoLoad = layer.getSource().getTileUrlFunction();
  1631 + if(funcaoLoad){
  1632 + layer.getSource().setTileUrlFunction(function() {
  1633 + var url = funcaoLoad.apply(this, arguments);
  1634 + url = url.replace("&cache=sim", "&cache=nao");
  1635 + //console.info(layer.getSource().getProperties().tipoServico)
  1636 + return url + '&r=' + Math.random();
  1637 + });
  1638 + }
1629 1639 }
1630   - // cache e um parametro especifico do i3geo
1631   - // utilizado por mapa_openlayers.php e mapa_googlemaps.php
1632   - layers[i].url = layers[i].url.replace("&cache=sim", "&cache=nao");
1633   - if (layers[i].visibility === true) {
1634   - layers[i].redraw();
  1640 + if(servico === "ImageWMS"){
  1641 + funcaoLoad = layer.getSource().getImageLoadFunction();
  1642 + if(funcaoLoad){
  1643 + layer.getSource().setImageLoadFunction(function(image,src) {
  1644 + src = src.replace("&cache=sim", "&cache=nao");
  1645 + src += '&r=' + Math.random();
  1646 + image.getImage().src = src;
  1647 + });
  1648 + }
1635 1649 }
1636 1650 }
1637 1651 }
... ... @@ -1641,16 +1655,30 @@ i3GEO.Interface =
1641 1655 * Forca o redesenho de um layer especifico
1642 1656 */
1643 1657 atualizaTema : function(retorno, tema) {
1644   - var layer = i3geoOL.getLayersByName(tema)[0], objtemas;
  1658 + var layer = i3geoOL.getLayersByName(tema)[0], objtemas, funcaoLoad, servico, source;
1645 1659 if (layer && layer != undefined) {
1646   - if (layer.url) {
1647   - layer.mergeNewParams({
1648   - r : Math.random()
1649   - });
1650   - layer.url = layer.url.replace("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&", "&foo=");
1651   - layer.url = layer.url + "&&";
1652   - layer.url = layer.url.replace("&cache=sim", "&cache=nao");
1653   - layer.redraw();
  1660 + source = layer.getSource();
  1661 + servico = source.getProperties().tipoServico;
  1662 + if(servico === "WMTS"){
  1663 + funcaoLoad = layer.getSource().getTileUrlFunction();
  1664 + if(funcaoLoad){
  1665 + layer.getSource().setTileUrlFunction(function() {
  1666 + var url = funcaoLoad.apply(this, arguments);
  1667 + url = url.replace("&cache=sim", "&cache=nao");
  1668 + //console.info(layer.getSource().getProperties().tipoServico)
  1669 + return url + '&r=' + Math.random();
  1670 + });
  1671 + }
  1672 + }
  1673 + if(servico === "ImageWMS"){
  1674 + funcaoLoad = layer.getSource().getImageLoadFunction();
  1675 + if(funcaoLoad){
  1676 + layer.getSource().setImageLoadFunction(function(image,src) {
  1677 + src = src.replace("&cache=sim", "&cache=nao");
  1678 + src += '&r=' + Math.random();
  1679 + image.getImage().src = src;
  1680 + });
  1681 + }
1654 1682 }
1655 1683 }
1656 1684 if (retorno === "") {
... ...