Commit 0ae1d80445a27b9db0c0a5c99e8f4dbf39d1a065
1 parent
574fbff4
Exists in
master
and in
7 other branches
Inclusão de parâmetros para storymap no editor de mapfiles
Showing
10 changed files
with
170 additions
and
140 deletions
Show diff stats
classesphp/classe_mapa.php
@@ -444,6 +444,14 @@ class Mapa | @@ -444,6 +444,14 @@ class Mapa | ||
444 | } | 444 | } |
445 | $ferramentas["tme"] = json_decode($f); | 445 | $ferramentas["tme"] = json_decode($f); |
446 | } | 446 | } |
447 | + //storymap | ||
448 | + if($oLayer->getmetadata("storymap") != ""){ | ||
449 | + $f = $oLayer->getmetadata("storymap"); | ||
450 | + if (!mb_detect_encoding($f,"UTF-8",true)){ | ||
451 | + $f = mb_convert_encoding($f,"UTF-8","ISO-8859-1"); | ||
452 | + } | ||
453 | + $ferramentas["storymap"] = json_decode($f); | ||
454 | + } | ||
447 | //formatacao antiga, antes da versao 6.0 | 455 | //formatacao antiga, antes da versao 6.0 |
448 | /* | 456 | /* |
449 | $temas[] = array( | 457 | $temas[] = array( |
ferramentas/atalhosedicao/index.js
@@ -132,6 +132,15 @@ i3GEOF.atalhosedicao = | @@ -132,6 +132,15 @@ i3GEOF.atalhosedicao = | ||
132 | } | 132 | } |
133 | }); | 133 | }); |
134 | $i("i3GEOFatalhosedicaoTme-button").style.width = "200px"; | 134 | $i("i3GEOFatalhosedicaoTme-button").style.width = "200px"; |
135 | + new YAHOO.widget.Button("i3GEOFatalhosedicaoStorymap", { | ||
136 | + onclick : { | ||
137 | + fn : function() { | ||
138 | + i3GEO.temaAtivo = i3GEOF.atalhosedicao.tema; | ||
139 | + i3GEO.tema.dialogo.storymap(i3GEOF.atalhosedicao.tema); | ||
140 | + } | ||
141 | + } | ||
142 | + }); | ||
143 | + $i("i3GEOFatalhosedicaoStorymap-button").style.width = "200px"; | ||
135 | // | 144 | // |
136 | //atualiza os campos que dependem de parametros de cada camada | 145 | //atualiza os campos que dependem de parametros de cada camada |
137 | // | 146 | // |
ferramentas/atalhosedicao/template_mst.html
@@ -65,4 +65,8 @@ | @@ -65,4 +65,8 @@ | ||
65 | <p class='paragrafo'> | 65 | <p class='paragrafo'> |
66 | <input id='i3GEOFatalhosedicaoTme' type='button' value='TME' /> | 66 | <input id='i3GEOFatalhosedicaoTme' type='button' value='TME' /> |
67 | </p> | 67 | </p> |
68 | + <br> | ||
69 | + <p class='paragrafo'> | ||
70 | + <input id='i3GEOFatalhosedicaoStorymap' type='button' value='Storymap' /> | ||
71 | + </p> | ||
68 | </div> | 72 | </div> |
69 | \ No newline at end of file | 73 | \ No newline at end of file |
ferramentas/storymap/default.php
@@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
3 | echo "&tema nao definido"; | 3 | echo "&tema nao definido"; |
4 | exit; | 4 | exit; |
5 | } | 5 | } |
6 | - if(!file_exists(dirname(__FILE__)."/../../temas/".$_GET["tema"])){ | 6 | + //echo dirname(__FILE__)."/../../temas/".$_GET["tema"]; |
7 | + if(!file_exists(dirname(__FILE__)."/../../temas/".$_GET["tema"].".map")){ | ||
7 | echo "&tema nao existe"; | 8 | echo "&tema nao existe"; |
8 | exit; | 9 | exit; |
9 | } | 10 | } |
ferramentas/storymap/dicionario.js
@@ -69,5 +69,15 @@ i3GEOF.storymap.dicionario = { | @@ -69,5 +69,15 @@ i3GEOF.storymap.dicionario = { | ||
69 | pt : "Coluna com a latitude (em DD)", | 69 | pt : "Coluna com a latitude (em DD)", |
70 | en : "", | 70 | en : "", |
71 | es : "" | 71 | es : "" |
72 | + } ], | ||
73 | + 'removePar' : [ { | ||
74 | + pt : "Remove os parâmetros armazenados no tema?", | ||
75 | + en : "", | ||
76 | + es : "" | ||
77 | + } ], | ||
78 | + 'incluiPar' : [ { | ||
79 | + pt : "Inclui os parâmetros no tema?", | ||
80 | + en : "", | ||
81 | + es : "" | ||
72 | } ] | 82 | } ] |
73 | }; | 83 | }; |
ferramentas/storymap/index.js
@@ -7,6 +7,8 @@ Abre apenas se o usuário estiver logado | @@ -7,6 +7,8 @@ Abre apenas se o usuário estiver logado | ||
7 | 7 | ||
8 | <i3GEO.tema.dialogo.storymap> | 8 | <i3GEO.tema.dialogo.storymap> |
9 | 9 | ||
10 | +Para testar utilize http://localhost/i3geo/ms_criamapa.php?temasa=_lreal | ||
11 | + | ||
10 | Arquivo: | 12 | Arquivo: |
11 | 13 | ||
12 | i3geo/ferramentas/storymap/index.js.php | 14 | i3geo/ferramentas/storymap/index.js.php |
@@ -109,7 +111,7 @@ i3GEOF.storymap = | @@ -109,7 +111,7 @@ i3GEOF.storymap = | ||
109 | inicia : function(iddiv) { | 111 | inicia : function(iddiv) { |
110 | var camada = ""; | 112 | var camada = ""; |
111 | i3GEO.janela.comboCabecalhoTemas("i3GEOFstoComboCabeca", "i3GEOFstoComboCabecaSel", "storymap", "ligadosComTabela"); | 113 | i3GEO.janela.comboCabecalhoTemas("i3GEOFstoComboCabeca", "i3GEOFstoComboCabecaSel", "storymap", "ligadosComTabela"); |
112 | - if(i3GEOF.storymap.tema === ""){ | 114 | + if (i3GEOF.storymap.tema === "") { |
113 | return; | 115 | return; |
114 | } | 116 | } |
115 | $i(iddiv).innerHTML = i3GEOF.storymap.html(); | 117 | $i(iddiv).innerHTML = i3GEOF.storymap.html(); |
@@ -120,45 +122,38 @@ i3GEOF.storymap = | @@ -120,45 +122,38 @@ i3GEOF.storymap = | ||
120 | // | 122 | // |
121 | if (i3GEO.arvoreDeCamadas) { | 123 | if (i3GEO.arvoreDeCamadas) { |
122 | camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.storymap.tema); | 124 | camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.storymap.tema); |
123 | - if (camada != "" && camada.ferramentas.storymap) { | ||
124 | - if(camada.ferramentas.storymap.auto === "sim"){ | ||
125 | - $i("ativaAoAdic").checked = true; | ||
126 | - } | ||
127 | - if(camada.ferramentas.storymap.exec === "sim"){ | ||
128 | - $i("execAoAdic").checked = true; | ||
129 | - } | ||
130 | - } | ||
131 | } | 125 | } |
132 | - //cria os combos de opcao | 126 | + // cria os combos de opcao |
133 | var temp = function(r) { | 127 | var temp = function(r) { |
134 | - var combo = function (dados, idonde){ | ||
135 | - var n,i,ins; | 128 | + var combo = function(dados, idonde) { |
129 | + var n, i, ins; | ||
136 | n = dados.length; | 130 | n = dados.length; |
137 | - ins = "<select id='"+idonde+"Combo' >"; | 131 | + ins = "<select id='" + idonde + "Combo' >"; |
138 | ins += "<option value='' >---</option>"; | 132 | ins += "<option value='' >---</option>"; |
139 | for (i = 0; i < n; i++) { | 133 | for (i = 0; i < n; i++) { |
140 | - ins += "<option value='"+dados[i]["item"]+"' >"+dados[i]["item"]+"</option>"; | 134 | + ins += "<option value='" + dados[i]["item"] + "' >" + dados[i]["item"] + "</option>"; |
141 | } | 135 | } |
142 | ins += "</select>"; | 136 | ins += "</select>"; |
143 | $i(idonde).innerHTML = ins; | 137 | $i(idonde).innerHTML = ins; |
144 | }; | 138 | }; |
145 | - combo(r.data.valores,"i3GEOstocolcabecalho"); | ||
146 | - combo(r.data.valores,"i3GEOstocoltexto"); | ||
147 | - combo(r.data.valores,"i3GEOstocollocal"); | ||
148 | - combo(r.data.valores,"i3GEOstocolicone"); | ||
149 | - combo(r.data.valores,"i3GEOstocolmedia"); | ||
150 | - combo(r.data.valores,"i3GEOstocollon"); | ||
151 | - combo(r.data.valores,"i3GEOstocollat"); | 139 | + combo(r.data.valores, "i3GEOstocolcabecalho"); |
140 | + combo(r.data.valores, "i3GEOstocoltexto"); | ||
141 | + combo(r.data.valores, "i3GEOstocollocal"); | ||
142 | + combo(r.data.valores, "i3GEOstocolicone"); | ||
143 | + combo(r.data.valores, "i3GEOstocolmedia"); | ||
144 | + combo(r.data.valores, "i3GEOstocollon"); | ||
145 | + combo(r.data.valores, "i3GEOstocollat"); | ||
152 | // se os parametros da ferramenta estiverem definidos na camada | 146 | // se os parametros da ferramenta estiverem definidos na camada |
153 | - if (camada != "" && camada.ferramentas.storymap && camada.ferramentas.storymap.exec === "sim") { | ||
154 | - i3GEO.util.defineValor("i3GEOstocolcabecalho", "value", camada.ferramentas.storymap.colcabecalho); | ||
155 | - i3GEO.util.defineValor("i3GEOstocoltexto", "value", camada.ferramentas.storymap.coltexto); | ||
156 | - i3GEO.util.defineValor("i3GEOstocollocal", "value", camada.ferramentas.storymap.collocal); | ||
157 | - i3GEO.util.defineValor("i3GEOstocolicone", "value", camada.ferramentas.storymap.colicone); | ||
158 | - i3GEO.util.defineValor("i3GEOstocolmedia", "value", camada.ferramentas.storymap.colmedia); | ||
159 | - i3GEO.util.defineValor("i3GEOstocollon", "value", camada.ferramentas.storymap.collon); | ||
160 | - i3GEO.util.defineValor("i3GEOstocollat", "value", camada.ferramentas.storymap.collat); | ||
161 | - i3GEOF.storymap.ativa(); | 147 | + if (camada != "" && camada.ferramentas.storymap) { |
148 | + $i("i3GEOStocabecalho").value = camada.ferramentas.storymap.cabecalho; | ||
149 | + $i("i3GEOStotexto").value = camada.ferramentas.storymap.texto; | ||
150 | + $i("i3GEOstocolcabecalhoCombo").value = camada.ferramentas.storymap.colcabecalho; | ||
151 | + $i("i3GEOstocoltextoCombo").value = camada.ferramentas.storymap.coltexto; | ||
152 | + $i("i3GEOstocollocalCombo").value = camada.ferramentas.storymap.collocal; | ||
153 | + $i("i3GEOstocoliconeCombo").value = camada.ferramentas.storymap.colicone; | ||
154 | + $i("i3GEOstocolmediaCombo").value = camada.ferramentas.storymap.colmedia; | ||
155 | + $i("i3GEOstocollonCombo").value = camada.ferramentas.storymap.collon; | ||
156 | + $i("i3GEOstocollatCombo").value = camada.ferramentas.storymap.collat; | ||
162 | } | 157 | } |
163 | }; | 158 | }; |
164 | i3GEO.php.listaItensTema(temp, i3GEOF.storymap.tema); | 159 | i3GEO.php.listaItensTema(temp, i3GEOF.storymap.tema); |
@@ -186,8 +181,8 @@ i3GEOF.storymap = | @@ -186,8 +181,8 @@ i3GEOF.storymap = | ||
186 | 181 | ||
187 | var b = new YAHOO.widget.Button("i3GEOstobotao1", { | 182 | var b = new YAHOO.widget.Button("i3GEOstobotao1", { |
188 | onclick : { | 183 | onclick : { |
189 | - fn : function(){ | ||
190 | - window.open(i3GEO.configura.locaplic+"/ferramentas/storymap/default.php?tema="+i3GEOF.storymap.tema); | 184 | + fn : function() { |
185 | + window.open(i3GEO.configura.locaplic + "/ferramentas/storymap/default.php?tema=" + i3GEOF.storymap.tema); | ||
191 | } | 186 | } |
192 | } | 187 | } |
193 | }); | 188 | }); |
@@ -257,68 +252,56 @@ i3GEOF.storymap = | @@ -257,68 +252,56 @@ i3GEOF.storymap = | ||
257 | }; | 252 | }; |
258 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); | 253 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
259 | }, | 254 | }, |
260 | - salvaParametros: function(){ | ||
261 | - //monta a string JSON que sera enviada para gravacao | ||
262 | - //'{"titulo":"População","colnome":"CNTRY_NAME","colsdata":["POP_CNTRY"],"lmax":"100000","amax":"2000000","auto":"sim","exec":"sim"}' | ||
263 | - var j, auto = "nao", exec = "nao"; | ||
264 | - if($i("ativaAoAdic").checked === true){ | ||
265 | - auto = "sim"; | ||
266 | - } | ||
267 | - if($i("execAoAdic").checked === true){ | ||
268 | - exec = "sim"; | ||
269 | - } | 255 | + salvaParametros : function() { |
256 | + var j; | ||
257 | + j = | ||
258 | + '{"cabecalho":"' + $i("i3GEOStocabecalho").value | ||
259 | + + '","texto":"' | ||
260 | + + $i("i3GEOStotexto").value | ||
261 | + + '","colcabecalho":"' | ||
262 | + + $i("i3GEOstocolcabecalhoCombo").value | ||
263 | + + '","coltexto":"' | ||
264 | + + $i("i3GEOstocoltextoCombo").value | ||
265 | + + '","collocal":"' | ||
266 | + + $i("i3GEOstocollocalCombo").value | ||
267 | + + '","colicone":"' | ||
268 | + + $i("i3GEOstocoliconeCombo").value | ||
269 | + + '","colmedia":"' | ||
270 | + + $i("i3GEOstocolmediaCombo").value | ||
271 | + + '","collon":"' | ||
272 | + + $i("i3GEOstocollonCombo").value | ||
273 | + + '","collat":"' | ||
274 | + + $i("i3GEOstocollatCombo").value | ||
275 | + + '"}'; | ||
270 | 276 | ||
271 | - j = '{"titulo":"' | ||
272 | - + $i("i3GEOTMEtitulo").value | ||
273 | - + '","colnome":"' | ||
274 | - + $i("i3GEOTMEregioes").value | ||
275 | - + '","colsdata":[' | ||
276 | - + '"' + colsdata.join('","') + '"' | ||
277 | - + '],"lmax":"' | ||
278 | - + $i("i3GEOTMEmaxHeight").value | ||
279 | - + '","amax":"' | ||
280 | - + $i("i3GEOTMEbarSize").value | ||
281 | - + '","outlinecolor":"' | ||
282 | - + $i("i3GEOTMEoutlinecolor").value | ||
283 | - + '","numvertices":"' | ||
284 | - + $i("i3GEOTMEnumvertices").value | ||
285 | - + '","auto":"' | ||
286 | - + auto | ||
287 | - + '","exec":"' | ||
288 | - + exec | ||
289 | - + '"}'; | 277 | + i3GEO.janela.confirma($trad("incluiPar", i3GEOF.storymap.dicionario), 300, $trad("x14"), "", function() { |
278 | + p = i3GEO.configura.locaplic + "/ferramentas/storymap/manutencao.php"; | ||
279 | + par = | ||
280 | + "&g_sid=" + i3GEO.configura.sid | ||
281 | + + "&tema=" | ||
282 | + + i3GEOF.storymap.tema | ||
283 | + + "&storymap=" | ||
284 | + + i3GEO.util.base64encode(j) | ||
285 | + + "&funcao=inclui"; | ||
286 | + | ||
287 | + retorno = function(retorno) { | ||
288 | + i3GEO.janela.fechaAguarde("storymap"); | ||
289 | + }; | ||
290 | + i3GEO.janela.abreAguarde("storymap", $trad("o1")); | ||
291 | + cpJSON.call(p, "foo", retorno, par); | ||
292 | + }); | ||
290 | 293 | ||
291 | - i3GEO.janela.confirma($trad("incluiPar", i3GEOF.storymap.dicionario), 300, $trad("x14"), | ||
292 | - "", function() { | ||
293 | - p = i3GEO.configura.locaplic + "/ferramentas/tme/manutencao.php"; | ||
294 | - par = "&g_sid=" + i3GEO.configura.sid | ||
295 | - + "&tema=" + i3GEOF.storymap.tema | ||
296 | - + "&tme=" + i3GEO.util.base64encode(j) | ||
297 | - + "&funcao=incluitme"; | ||
298 | - | ||
299 | - retorno = | ||
300 | - function(retorno) { | ||
301 | - i3GEO.janela.fechaAguarde("tme"); | ||
302 | - }; | ||
303 | - i3GEO.janela.abreAguarde("tme", $trad("o1")); | ||
304 | - cpJSON.call(p, "foo", retorno, par); | ||
305 | - }); | ||
306 | - | ||
307 | }, | 294 | }, |
308 | - removeParametros: function(){ | ||
309 | - i3GEO.janela.confirma($trad("removePar", i3GEOF.storymap.dicionario), 300, $trad("x14"), | ||
310 | - "", function() { | ||
311 | - p = i3GEO.configura.locaplic + "/ferramentas/tme/manutencao.php"; | ||
312 | - par = "&g_sid=" + i3GEO.configura.sid | ||
313 | - + "&tema=" + i3GEOF.storymap.tema | ||
314 | - + "&funcao=removetme"; | ||
315 | - | ||
316 | - retorno = | ||
317 | - function(retorno) { | ||
318 | - i3GEO.janela.fechaAguarde("tme"); | ||
319 | - }; | ||
320 | - i3GEO.janela.abreAguarde("tme", $trad("o1")); | ||
321 | - cpJSON.call(p, "foo", retorno, par); | ||
322 | - }); | 295 | + removeParametros : function() { |
296 | + i3GEO.janela.confirma($trad("removePar", i3GEOF.storymap.dicionario), 300, $trad("x14"), "", function() { | ||
297 | + p = i3GEO.configura.locaplic + "/ferramentas/storymap/manutencao.php"; | ||
298 | + par = "&g_sid=" + i3GEO.configura.sid + "&tema=" + i3GEOF.storymap.tema + "&funcao=remove"; | ||
299 | + | ||
300 | + retorno = function(retorno) { | ||
301 | + i3GEO.janela.fechaAguarde("storymap"); | ||
302 | + }; | ||
303 | + i3GEO.janela.abreAguarde("storymap", $trad("o1")); | ||
304 | + cpJSON.call(p, "foo", retorno, par); | ||
305 | + }); | ||
323 | } | 306 | } |
324 | }; | 307 | }; |
325 | \ No newline at end of file | 308 | \ No newline at end of file |
ferramentas/storymap/manutencao.php
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | include_once(dirname(__FILE__)."/../inicia.php"); | 2 | include_once(dirname(__FILE__)."/../inicia.php"); |
3 | include_once(dirname(__FILE__)."/../../admin/php/login.php"); | 3 | include_once(dirname(__FILE__)."/../../admin/php/login.php"); |
4 | $funcoesEdicao = array( | 4 | $funcoesEdicao = array( |
5 | - "REMOVETME", | ||
6 | - "INCLUITME" | 5 | + "REMOVE", |
6 | + "INCLUI" | ||
7 | ); | 7 | ); |
8 | if(in_array(strtoupper($funcao),$funcoesEdicao)){ | 8 | if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
9 | if(verificaOperacaoSessao("admin/html/editormapfile") == false){ | 9 | if(verificaOperacaoSessao("admin/html/editormapfile") == false){ |
@@ -17,11 +17,11 @@ error_reporting(0); | @@ -17,11 +17,11 @@ error_reporting(0); | ||
17 | $retorno = ""; //string que será retornada ao browser via JSON | 17 | $retorno = ""; //string que será retornada ao browser via JSON |
18 | switch (strtoupper($funcao)) | 18 | switch (strtoupper($funcao)) |
19 | { | 19 | { |
20 | - case "REMOVETME": | 20 | + case "REMOVE": |
21 | $mapa = ms_newMapObj($map_file); | 21 | $mapa = ms_newMapObj($map_file); |
22 | $l = $mapa->getlayerbyname($tema); | 22 | $l = $mapa->getlayerbyname($tema); |
23 | if($l != ""){ | 23 | if($l != ""){ |
24 | - $l->setmetadata("tme",""); | 24 | + $l->setmetadata("storymap",""); |
25 | $mapa->save($map_file); | 25 | $mapa->save($map_file); |
26 | } | 26 | } |
27 | $arq = $locaplic."/temas/".$tema.".map"; | 27 | $arq = $locaplic."/temas/".$tema.".map"; |
@@ -29,18 +29,18 @@ switch (strtoupper($funcao)) | @@ -29,18 +29,18 @@ switch (strtoupper($funcao)) | ||
29 | $mapa = ms_newMapObj($arq); | 29 | $mapa = ms_newMapObj($arq); |
30 | $l = $mapa->getlayerbyname($tema); | 30 | $l = $mapa->getlayerbyname($tema); |
31 | if($l != ""){ | 31 | if($l != ""){ |
32 | - $l->setmetadata("tme",""); | 32 | + $l->setmetadata("storymap",""); |
33 | $mapa->save($arq); | 33 | $mapa->save($arq); |
34 | removeCabecalho($arq); | 34 | removeCabecalho($arq); |
35 | } | 35 | } |
36 | } | 36 | } |
37 | $retorno = "ok"; | 37 | $retorno = "ok"; |
38 | break; | 38 | break; |
39 | - case "INCLUITME": | 39 | + case "INCLUI": |
40 | $mapa = ms_newMapObj($map_file); | 40 | $mapa = ms_newMapObj($map_file); |
41 | $l = $mapa->getlayerbyname($tema); | 41 | $l = $mapa->getlayerbyname($tema); |
42 | if($l != ""){ | 42 | if($l != ""){ |
43 | - $l->setmetadata("tme",base64_decode($tme)); | 43 | + $l->setmetadata("storymap",base64_decode($storymap)); |
44 | $mapa->save($map_file); | 44 | $mapa->save($map_file); |
45 | } | 45 | } |
46 | $arq = $locaplic."/temas/".$tema.".map"; | 46 | $arq = $locaplic."/temas/".$tema.".map"; |
@@ -48,7 +48,7 @@ switch (strtoupper($funcao)) | @@ -48,7 +48,7 @@ switch (strtoupper($funcao)) | ||
48 | $mapa = ms_newMapObj($arq); | 48 | $mapa = ms_newMapObj($arq); |
49 | $l = $mapa->getlayerbyname($tema); | 49 | $l = $mapa->getlayerbyname($tema); |
50 | if($l != ""){ | 50 | if($l != ""){ |
51 | - $l->setmetadata("tme",base64_decode($tme)); | 51 | + $l->setmetadata("storymap",base64_decode($storymap)); |
52 | $mapa->save($arq); | 52 | $mapa->save($arq); |
53 | removeCabecalho($arq); | 53 | removeCabecalho($arq); |
54 | } | 54 | } |
interface/black_editor.php
@@ -193,7 +193,7 @@ | @@ -193,7 +193,7 @@ | ||
193 | format : "jpeg" | 193 | format : "jpeg" |
194 | }, { | 194 | }, { |
195 | isBaseLayer : true, | 195 | isBaseLayer : true, |
196 | - visibility : false | 196 | + visibility : true |
197 | }); | 197 | }); |
198 | var bra = new OpenLayers.Layer.WMS( | 198 | var bra = new OpenLayers.Layer.WMS( |
199 | "Base carto MMA", | 199 | "Base carto MMA", |
json.php
@@ -126,15 +126,26 @@ $oMap = ms_newMapobj($nomeMapfileTmp); | @@ -126,15 +126,26 @@ $oMap = ms_newMapobj($nomeMapfileTmp); | ||
126 | $data = pegaDadosJ(); | 126 | $data = pegaDadosJ(); |
127 | if($format == "storymap"){ | 127 | if($format == "storymap"){ |
128 | //parametros via URL | 128 | //parametros via URL |
129 | - $cabecalho = converteenc("Cabeçalho do primeiro slide"); | ||
130 | - $texto = "Texto do primeiro slide"; | ||
131 | - $coltexto = "COMENTARIO"; | ||
132 | - $colcabecalho = "NOME"; | ||
133 | - $collocal = "ZONA"; | ||
134 | - $colicone = ""; | ||
135 | - $collon = "LONGITUDE"; | ||
136 | - $collat = "LATITUDE"; | ||
137 | - $colmedia = "URL"; | 129 | + $layer = $oMap->getlayerbyname($tema); |
130 | + if($layer == ""){ | ||
131 | + echo "Layer nao encontrado"; | ||
132 | + exit; | ||
133 | + } | ||
134 | + $storymap = $layer->getmetadata("storymap"); | ||
135 | + if($storymap == ""){ | ||
136 | + echo "Parametros nao definidos no METADATA storymap"; | ||
137 | + exit; | ||
138 | + } | ||
139 | + $storymap = json_decode($storymap,true); | ||
140 | + $cabecalho = converteenc($storymap["cabecalho"]); | ||
141 | + $texto = converteenc($storymap["texto"]); | ||
142 | + $coltexto = $storymap["coltexto"]; | ||
143 | + $colcabecalho = $storymap["colcabecalho"]; | ||
144 | + $collocal = $storymap["collocal"]; | ||
145 | + $colicone = $storymap["colicone"]; | ||
146 | + $collon = $storymap["collon"]; | ||
147 | + $collat = $storymap["collat"]; | ||
148 | + $colmedia = $storymap["colmedia"]; | ||
138 | 149 | ||
139 | $par = array( | 150 | $par = array( |
140 | "cabecalho"=>$cabecalho, | 151 | "cabecalho"=>$cabecalho, |
@@ -211,6 +222,7 @@ function storymap($par){ | @@ -211,6 +222,7 @@ function storymap($par){ | ||
211 | ); | 222 | ); |
212 | //echo "<pre>";var_dump($j);exit; | 223 | //echo "<pre>";var_dump($j);exit; |
213 | $contents = json_encode($j); | 224 | $contents = json_encode($j); |
225 | + //var_dump($contents);exit; | ||
214 | file_put_contents($nomeArq.".json",$contents); | 226 | file_put_contents($nomeArq.".json",$contents); |
215 | //envia para download | 227 | //envia para download |
216 | ob_clean(); | 228 | ob_clean(); |
temas/_lreal.map
1 | -MAP | ||
2 | - FONTSET "../symbols/fontes.txt" | ||
3 | - SYMBOLSET "../symbols/simbolosv6.sym" | ||
4 | - LAYER | ||
5 | - CONNECTION "" | ||
6 | - DATA "/var/www/i3geo/aplicmap/dados/estradareal/novo.shp" | ||
7 | - METADATA | ||
8 | - "CLASSE" "SIM" | ||
9 | - "TEMA" "Caminho Novo Estrada Real" | ||
10 | - END # METADATA | ||
11 | - NAME "_lreal" | ||
12 | - PROCESSING "LABEL_NO_CLIP=True" | ||
13 | - PROCESSING "POLYLINE_NO_CLIP=True" | ||
14 | - STATUS DEFAULT | ||
15 | - TEMPLATE "none.htm" | ||
16 | - TYPE POINT | ||
17 | - UNITS METERS | ||
18 | - CLASS | ||
19 | - NAME "" | ||
20 | - STYLE | ||
21 | - COLOR 250 0 0 | ||
22 | - SIZE 15 | ||
23 | - SYMBOL "ponto" | ||
24 | - END # STYLE | ||
25 | - TITLE "" | ||
26 | - END # CLASS | ||
27 | - | ||
28 | - END # LAYER | ||
29 | -END # MAP | 1 | +MAP |
2 | + FONTSET "../symbols/fontes.txt" | ||
3 | + SYMBOLSET "../symbols/simbolosv6.sym" | ||
4 | + LAYER | ||
5 | + CONNECTION "" | ||
6 | + DATA "/var/www/i3geo/aplicmap/dados/estradareal/novo.shp" | ||
7 | + METADATA | ||
8 | + "CLASSE" "SIM" | ||
9 | + "TEMA" "Caminho Novo Estrada Real" | ||
10 | + "storymap" '{"cabecalho":"Primeiro slide","texto":"Texto do primeiro slide da apresentação","colcabecalho":"NOME","coltexto":"COMENTARIO","collocal":"NOME","colicone":"","colmedia":"URL","collon":"LONGITUDE","collat":"LATITUDE"}' | ||
11 | + END # METADATA | ||
12 | + NAME "_lreal" | ||
13 | + PROCESSING "LABEL_NO_CLIP=True" | ||
14 | + PROCESSING "POLYLINE_NO_CLIP=True" | ||
15 | + STATUS DEFAULT | ||
16 | + TEMPLATE "none.htm" | ||
17 | + TILEITEM "location" | ||
18 | + TYPE POINT | ||
19 | + UNITS METERS | ||
20 | + CLASS | ||
21 | + NAME "" | ||
22 | + STYLE | ||
23 | + COLOR 250 0 0 | ||
24 | + SIZE 15 | ||
25 | + SYMBOL "ponto" | ||
26 | + END # STYLE | ||
27 | + TITLE "" | ||
28 | + END # CLASS | ||
29 | + END # LAYER | ||
30 | + | ||
31 | +END # MAP | ||
32 | + |