meu nome é Leandro, trabalho no CASNAV na Marinha-RJ. No projeto em que trabalho, quando o usuário loga no sistema, ele carrega o .map salvo na sessão anteiror.
Quero obter os filtros existentes nas layers do map. O i3Geo possui uma funcionalidade mas apenas quando trata de uma camada de cada vez.
Diante disso fiz um loop utilizando o objeto cpaint mas o algoritmo não funcionou. O código em javascript eu postei abaixo: getFiltroInicial.
Além disso tenho observado que essas chamadas cpObj.call() não tem funcionado se tento trabalhar de maneira síncrona.
cpObj.set_async(false);
cpObj.call(...);
cpObj.set_async(true);
Até agora, só consegui trabalhar em modo síncrono utilizando a função 'ligatemas'.
Att,
Leandro.
**************************************************************************
function getFiltroInicial()
{
var layer = new Array("layer1","layer2","layer3");
var i;
//
var temp = function(filtro)
{
filtroInicial = filtro.data;
if ( (filtroInicial != undefined) && (filtroInicial != '') )
{
alert(layer[i]+" :: "+filtroInicial);
/*
continuação do algoritmo ...
*/
}
}
for (i=0;i < layer.length; i++)
{
var cpObj = new cpaint();
cpObj.set_response_type("JSON");
//
var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=pegafiltro&tema="+layer[i];
cpObj.call(p,"pegaFiltro",temp);
}
}
Autor: Leandro Ouriques

66 comentários
como uma variável para processar o retorno.
Veja se dessa forma funciona: function getFiltroInicial()
{
layer = new Array("layer1","layer2","layer3");
//var i;
// for (i=0;i {
var cpObj = new cpaint();
cpObj.set_response_type("JSON");
cpObj.set_async(true);
//
var p =
g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=pegafiltro&tema="+layer[i]; cpObj.call(p,"pegaFiltro",temp);
}
}
function temp(filtro)
{
filtroInicial = filtro.data;
if ( (filtroInicial != undefined) && (filtroInicial != '') )
{
alert(layer[i]+" :: "+filtroInicial);
/*
continuação do algoritmo ...
*/
}
} louriques@yahoo.com.br escreveu:
> Forum: Geral - usuários e desenvolvedores
>
> Thread: Obter Filtros das Layers
>
> Author: Leandro Ouriques
> Posted: 2008-08-13 10:35:51.498013-03
>
> Bom dia,
>
> meu nome é Leandro, trabalho no CASNAV na Marinha-RJ. No projeto em
> que trabalho, quando o usuário loga no sistema, ele carrega o .map
> salvo na sessão anteiror.
>
> Quero obter os filtros existentes nas layers do map. O i3Geo possui
> uma funcionalidade mas apenas quando trata de uma camada de cada vez.
>
> Diante disso fiz um loop utilizando o objeto cpaint mas o algoritmo
> não funcionou. O código em javascript eu postei abaixo: getFiltroInicial.
>
> Além disso tenho observado que essas chamadas cpObj.call() não tem
> funcionado se tento trabalhar de maneira síncrona.
>
> cpObj.set_async(false);
> cpObj.call(...);
> cpObj.set_async(true);
>
> Até agora, só consegui trabalhar em modo síncrono utilizando a função
> 'ligatemas'.
>
> Att,
> Leandro.
>
> **************************************************************************
>
>
> function getFiltroInicial()
> {
> var layer = new Array("layer1","layer2","layer3");
> var i;
> //
> var temp = function(filtro)
> {
> filtroInicial = filtro.data;
> if ( (filtroInicial != undefined) && (filtroInicial != '') )
> {
> alert(layer[i]+" :: "+filtroInicial);
> /*
> continuação do algoritmo ...
> */
> }
> }
> for (i=0;i > {
> var cpObj = new cpaint();
> cpObj.set_response_type("JSON");
> //
> var p =
> g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=pegafiltro&tema="+layer[i];
>
> cpObj.call(p,"pegaFiltro",temp);
> }
> }
>
> Recebendo correspondência demais? Gerencie suas notificações em:
> www.softwarepublico.gov.br/notifications/manage
> -- Edmar Moretti
CGTI/MMA
Área de Gestão de Geotecnologias
Gerente de Projetos skype: edmar.moretti
breve possível. Spans não são abertos e muito menos lidos, apenas excluídos.
Fone:(67) 3382-8034
Cel: (67) 9925-0512
BEM AMBIENTAL ENGENHARIA --
Orlando Pissuto Trevisan
Engenheiro Ambiental - Mestre em Gestão e Impacto Ambiental.
Fone:(67) 3382-8034
Cel: (67) 9925-0512
BEM AMBIENTAL ENGENHARIA
Só é necessário realizá-la uma única vez. Se o procedimento acima não for efetuado, seu e-mail não poderá ser entregue. Esta mensagem foi gerada automaticamente pelo sistema anti-spam. The message you sent requires that you verify that you
are a real live human being and not a spam source. To complete this verification, simply reply to this message and leave the subject line intact. The headers of the message sent from your address are show below: >From notification-6153498-1213@www.softwarepublico.gov.br Sat Sep 20 03:31:40 2008
Received: from mail.softwarepublico.gov.br ([200.198.213.155])
by beta.planethost.com.br with esmtp (Exim 4.69)
(envelope-from )
id 1Kgw0K-0005zn-2W
for alejandro@casatrancoso.com.br; Sat, 20 Sep 2008 03:31:40 -0300
Received: from www.softwarepublico.gov.br (nodo405.labcluster [192.168.9.37])
by mail.softwarepublico.gov.br (Postfix) with ESMTP id 613E559D4F
for ; Sat, 20 Sep 2008 03:40:39 -0300 (BRT)
MIME-Version: 1.0
Content-ID:
message-id:
date: Sat, 20 Sep 2008 03:30:45 -0300
Subject: =?UTF-8?Q?=5BGeral_-_usu=C3=A1rios_e_desenvolvedores=5D_Re:...?=
From: "www.softwarepublico.gov.br mailer"
Reply-To: "www.softwarepublico.gov.br mailer"
To: alejandro@casatrancoso.com.br
Content-Type: multipart/alternative;
boundary="----- =_8l9InI//kfmpG0UNufhRkg=="