Commit d110a84f7d0158c98055698747822739c924734c
1 parent
99ef062a
Exists in
master
and in
7 other branches
O tema adicionado ao mapa, em função da busca, passa a ter o nome composto pelo …
…nome encontrado e nome da camada.
Showing
1 changed file
with
8 additions
and
7 deletions
Show diff stats
ferramentas/buscarapida/index.js
| @@ -38,10 +38,11 @@ function busca() | @@ -38,10 +38,11 @@ function busca() | ||
| 38 | for (j=0;j<retorno.data.geonames[i].lugares.length; j++) | 38 | for (j=0;j<retorno.data.geonames[i].lugares.length; j++) |
| 39 | { | 39 | { |
| 40 | ins += "<tr><td style='text-align:left'>" | 40 | ins += "<tr><td style='text-align:left'>" |
| 41 | - ins += retorno.data.geonames[i].lugares[j].nome; | 41 | + var nm = retorno.data.geonames[i].lugares[j].nome; |
| 42 | + ins += nm; | ||
| 42 | var wkt = retorno.data.geonames[i].lugares[j].limite | 43 | var wkt = retorno.data.geonames[i].lugares[j].limite |
| 43 | var gid = retorno.data.geonames[i].lugares[j].gid | 44 | var gid = retorno.data.geonames[i].lugares[j].gid |
| 44 | - ins += "</td><td onclick=\"zoom('"+wkt+"','"+layer+"','"+gid+"')\" onmouseover=\"mostraxy('"+wkt+"')\" onmouseout='escondexy()' style='color:blue;cursor:pointer'>zoom</td></tr>" | 45 | + ins += "</td><td onclick=\"zoom('"+wkt+"','"+layer+"','"+gid+"','"+nm+"')\" onmouseover=\"mostraxy('"+wkt+"')\" onmouseout='escondexy()' style='color:blue;cursor:pointer'>zoom</td></tr>" |
| 45 | } | 46 | } |
| 46 | } | 47 | } |
| 47 | ins += "</table>" | 48 | ins += "</table>" |
| @@ -89,15 +90,15 @@ function mostraxy(wkt) | @@ -89,15 +90,15 @@ function mostraxy(wkt) | ||
| 89 | box.style.left = xyMin[0]+"px" | 90 | box.style.left = xyMin[0]+"px" |
| 90 | 91 | ||
| 91 | } | 92 | } |
| 92 | -function zoom(wkt,layer,gid) | 93 | +function zoom(wkt,layer,gid,nm) |
| 93 | { | 94 | { |
| 94 | - var adicionaCamada = function(layer,gid) | 95 | + var adicionaCamada = function(layer,gid,nm) |
| 95 | { | 96 | { |
| 96 | var s = "&tema="+layer | 97 | var s = "&tema="+layer |
| 97 | s += "&servico=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | 98 | s += "&servico=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; |
| 98 | s += "&nome=default" | 99 | s += "&nome=default" |
| 99 | - s += "&proj=EPSG:4291&formato=image/png&nomecamada="+layer | ||
| 100 | - s += "&suportasld=nao&versao=1.1.0"; | 100 | + s += "&proj=EPSG:4291&formato=image/png&nomecamada="+nm+" - "+layer |
| 101 | + s += "&suportasld=nao&versao=1.1.0" | ||
| 101 | var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adicionatemawms&g_sid="+g_sid+s; | 102 | var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adicionatemawms&g_sid="+g_sid+s; |
| 102 | var cp = new cpaint(); | 103 | var cp = new cpaint(); |
| 103 | //cp.set_debug(2) | 104 | //cp.set_debug(2) |
| @@ -128,7 +129,7 @@ function zoom(wkt,layer,gid) | @@ -128,7 +129,7 @@ function zoom(wkt,layer,gid) | ||
| 128 | var cp = new cpaint(); | 129 | var cp = new cpaint(); |
| 129 | //cp.set_debug(2) | 130 | //cp.set_debug(2) |
| 130 | cp.set_response_type("JSON"); | 131 | cp.set_response_type("JSON"); |
| 131 | - cp.call(p,"mudaExtensao",adicionaCamada(layer,gid)); | 132 | + cp.call(p,"mudaExtensao",adicionaCamada(layer,gid,nm)); |
| 132 | 133 | ||
| 133 | } | 134 | } |
| 134 | function sortNumber(a,b) | 135 | function sortNumber(a,b) |