Commit 9e5d9dcc81ac8057b6e1e99acd944c44488c2143

Authored by Edmar Moretti
1 parent 1ff7aa31

--no commit message

admin/php/metaestat_uploadshp_submit.php
... ... @@ -204,7 +204,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])){
204 204 }
205 205 else{
206 206 $valor = $s->getValue($layer,$coluna);
207   - if($valor = "" || (empty($valor) && $valor != 0)){
  207 + if($valor == "" || (empty($valor) && $valor != 0)){
208 208 $valor = 'nulo';
209 209 }
210 210 $vs[] = $valor;
... ...
ferramentas/metaestat/editorlimites.js
... ... @@ -206,7 +206,13 @@ i3GEOF.editorlimites = {
206 206 * @param objeto shape que sera marcado
207 207 */
208 208 setSelection: function(shape){
209   - shape.setEditable(!shape.editable);
  209 + if(shape.setEditable){
  210 + shape.setEditable(!shape.editable);
  211 + }
  212 + else{
  213 + shape.editable = true;
  214 + shape.setFlat(false);
  215 + }
210 216 },
211 217 /**
212 218 * Marca todas as figuras como nao selecionadas
... ... @@ -216,9 +222,30 @@ i3GEOF.editorlimites = {
216 222 var i,
217 223 n = i3GEOF.editorlimites.shapes.length;
218 224 for(i=0;i<n;i++){
219   - if(i3GEOF.editorlimites.shapes[i] != ""){
  225 + if(i3GEOF.editorlimites.shapes[i] != "" && i3GEOF.editorlimites.shapes[i].setEditable){
220 226 i3GEOF.editorlimites.shapes[i].setEditable(false);
221 227 }
  228 + else if(i3GEOF.editorlimites.shapes[i] != ""){//caso for ponto
  229 + i3GEOF.editorlimites.shapes[i].editable = false;
  230 + i3GEOF.editorlimites.shapes[i].setFlat(true);
  231 + }
  232 + }
  233 + },
  234 + /**
  235 + * Marca todas as figuras como selecionadas
  236 + * As figuras existentes no mapa sao mantidas na variavel i3GEOF.editorlimites.shapes
  237 + */
  238 + selectAll: function(){
  239 + var i,
  240 + n = i3GEOF.editorlimites.shapes.length;
  241 + for(i=0;i<n;i++){
  242 + if(i3GEOF.editorlimites.shapes[i] != "" && i3GEOF.editorlimites.shapes[i].setEditable){
  243 + i3GEOF.editorlimites.shapes[i].setEditable(true);
  244 + }
  245 + else if(i3GEOF.editorlimites.shapes[i] != ""){//caso for ponto
  246 + i3GEOF.editorlimites.shapes[i].editable = true;
  247 + i3GEOF.editorlimites.shapes[i].setFlat(false);
  248 + }
222 249 }
223 250 },
224 251 /**
... ... @@ -240,10 +267,16 @@ i3GEOF.editorlimites = {
240 267 }
241 268 if(x){
242 269 for(i=0;i<n;i++){
243   - if(i3GEOF.editorlimites.shapes[i] != "" && i3GEOF.editorlimites.shapes[i].editable === true){
  270 + if(i3GEOF.editorlimites.shapes[i] != "" && i3GEOF.editorlimites.shapes[i].editable && i3GEOF.editorlimites.shapes[i].editable === true){
244 271 i3GEOF.editorlimites.shapes[i].setMap(null);
245 272 i3GEOF.editorlimites.shapes[i] = "";
246 273 }
  274 + else{ //caso for ponto
  275 + if(i3GEOF.editorlimites.shapes[i] != ""){
  276 + i3GEOF.editorlimites.shapes[i].setMap(null);
  277 + i3GEOF.editorlimites.shapes[i] = "";
  278 + }
  279 + }
247 280 }
248 281 }
249 282 }
... ... @@ -314,7 +347,6 @@ i3GEOF.editorlimites = {
314 347 */
315 348 ativa: function(botao){
316 349 i3GEOF.editorlimites.mudaicone(botao);
317   -
318 350 i3GEO.eventos.cliquePerm.desativa();
319 351 if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEOF.editorlimites.capturaPoligonoTema.captura()") < 0)
320 352 {i3GEO.eventos.MOUSECLIQUE.push("i3GEOF.editorlimites.capturaPoligonoTema.captura()");}
... ... @@ -330,7 +362,6 @@ i3GEOF.editorlimites = {
330 362 captura: function(){
331 363 var temp,tema="",regiao="",p,par,
332 364 aguarde = $i("janelaEditorLimites_imagemCabecalho");
333   - i3GEOF.editorlimites.mudaicone();
334 365 if(!$i("i3geoCartoRegioesEditaveis")){
335 366 i3GEO.eventos.MOUSECLIQUE.remove("i3GEOF.editorlimites.capturaPoligonoTema.captura()");
336 367 }
... ... @@ -352,6 +383,7 @@ i3GEOF.editorlimites = {
352 383 i3GEO.janela.tempoMsg("Nada encontrado");
353 384 return;
354 385 }
  386 + i3GEOF.editorlimites.mudaicone();
355 387 n = temp.length;
356 388 for(i=0;i<n;i++){
357 389 if(temp[i].alias == "wkt"){
... ... @@ -391,7 +423,7 @@ i3GEOF.editorlimites = {
391 423 if(aguarde && aguarde.style.visibility == "hidden"){
392 424 aguarde.style.visibility = "visible";
393 425 p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php";
394   - par = "funcao=identifica3&opcao=tema&xy="+objposicaocursor.ddx+","+objposicaocursor.ddy+"&resolucao=1&g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.parametros.mapexten+"&listaDeTemas=&wkt=sim&tema="+tema;
  426 + par = "funcao=identifica3&opcao=tema&xy="+objposicaocursor.ddx+","+objposicaocursor.ddy+"&resolucao=5&g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.parametros.mapexten+"&listaDeTemas=&wkt=sim&tema="+tema;
395 427 cpJSON.call(p,"identifica",temp,par);
396 428 }
397 429 }
... ... @@ -492,6 +524,7 @@ i3GEOF.editorlimites = {
492 524 },
493 525 /**
494 526 * Adiciona uma nova figura ao mapa (shape)
  527 + * Pode ser poligono ou ponto
495 528 * @param objeto shape (API do Google)
496 529 * @param codigo do layer que sera vinculado ao shape
497 530 * @param coluna do tema que contem os identificadores de cada um de seus elementos (registros)
... ... @@ -565,6 +598,10 @@ i3GEOF.editorlimites = {
565 598 return;
566 599 }
567 600 if (obj.type === 'marker'){
  601 + i3GEOF.editorlimites.selectAll();
  602 + if(i3GEOF.editorlimites.shapes.length > 0){
  603 + i3GEOF.editorlimites.deleteSelectedShape(true);
  604 + }
568 605 pol = new google.maps.Marker({
569 606 position: new google.maps.LatLng(obj.getPosition().ob,obj.getPosition().pb),
570 607 map: i3GeoMap,
... ... @@ -578,7 +615,9 @@ i3GEOF.editorlimites = {
578 615 colunaid: colunaid,
579 616 valorid: valorid,
580 617 colunanome: colunanome,
581   - valornome: valornome
  618 + valornome: valornome,
  619 + flat: true,
  620 + editable: false
582 621 });
583 622 google.maps.event.addListener(pol, 'click', function() {
584 623 i3GEOF.editorlimites.setSelection(pol);
... ... @@ -1075,4 +1114,4 @@ i3GEOF.editorlimites = {
1075 1114 "</table>";
1076 1115 $i("editaAtributosAjuda_corpo").innerHTML = html;
1077 1116 }
1078   -};
1079 1117 \ No newline at end of file
  1118 +};
... ...