contaN = 0; objcontype = [ {texto:"MS_INLINE",valor:"0"}, {texto:"MS_SHAPEFILE",valor:"1"}, {texto:"MS_TILED_SHAPEFILE",valor:"2"}, {texto:"MS_SDE",valor:"3"}, {texto:"MS_OGR",valor:"4"}, {texto:"MS_TILED_OGR",valor:"5"}, {texto:"MS_POSTGIS",valor:"6"}, {texto:"MS_WMS",valor:"7"}, {texto:"MS_ORACLESPATIAL",valor:"8"}, {texto:"MS_WFS",valor:"9"}, {texto:"MS_GRATICULE",valor:"10"}, {texto:"MS_MYGIS",valor:"11"}, {texto:"MS_RASTER",valor:"12"}, {texto:"MS_PLUGIN",valor:"13"} ]; objbool_tf = [ {texto:"MS_TRUE",valor:"0"}, {texto:"MS_FALSE",valor:"1"} ]; objbool_of = [ {texto:"MS_ON",valor:"2"}, {texto:"MS_OFF",valor:"3"} ]; objbool_yn = [ {texto:"MS_YES",valor:"4"}, {texto:"MS_NO",valor:"5"} ]; objmapunits = [ {texto:"MS_INCHES",valor:"0"}, {texto:"MS_FEET",valor:"1"}, {texto:"MS_MILES",valor:"2"}, {texto:"MS_METERS",valor:"3"}, {texto:"MS_KILOMETERS",valor:"4"}, {texto:"MS_DD",valor:"5"}, {texto:"MS_PIXELS",valor:"6"} ]; objlayertypes = [ {texto:"MS_LAYER_POINT",valor:"0"}, {texto:"MS_LAYER_LINE",valor:"1"}, {texto:"MS_LAYER_POLYGON",valor:"2"}, {texto:"MS_LAYER_RASTER",valor:"3"}, {texto:"MS_LAYER_ANNOTATION",valor:"4"}, {texto:"MS_LAYER_QUERY",valor:"5"}, {texto:"MS_LAYER_CIRCLE",valor:"6"}, {texto:"MS_LAYER_TILEINDEX",valor:"7"}, {texto:"MS_LAYER_CHART",valor:"8"} ]; objstatus = [ {texto:"MS_ON",valor:"1"}, {texto:"MS_OFF",valor:"0"}, {texto:"MS_DEFAULT",valor:"2"} ]; objfonttypes = [ {texto:"MS_TRUETYPE",valor:"0"}, {texto:"MS_BITMAP",valor:"1"} ]; objposition = [ {texto:"MS_UL",valor:"0"}, {texto:"MS_LR",valor:"1"}, {texto:"MS_UR",valor:"2"}, {texto:"MS_LL",valor:"3"}, {texto:"MS_CR",valor:"4"}, {texto:"MS_CL",valor:"5"}, {texto:"MS_UC",valor:"6"}, {texto:"MS_WMS",valor:"7"}, {texto:"MS_LC",valor:"8"}, {texto:"MS_CC",valor:"9"}, {texto:"MS_AUTO",valor:"10"}, {texto:"MS_XY",valor:"11"}, {texto:"MS_FOLLOW",valor:"12"} ]; objfontstyle = [ {texto:"MS_TINY",valor:"0"}, {texto:"MS_SMALL",valor:"1"}, {texto:"MS_MEDIUM",valor:"2"}, {texto:"MS_LARGE",valor:"3"}, {texto:"MS_GIANT",valor:"4"}, ]; objshapetype = [ {texto:"MS_SHAPE_POINT",valor:"0"}, {texto:"MS_SHAPE_LINE",valor:"1"}, {texto:"MS_SHAPE_POLYGON",valor:"2"}, {texto:"MS_SHAPE_NULL",valor:"3"} ]; objshapefiletype = [ {texto:"MS_SHP_POINT",valor:"0"}, {texto:"MS_SHP_ARC",valor:"1"}, {texto:"MS_SHP_POLYGON",valor:"2"}, {texto:"MS_SHP_MULTIPOINT",valor:"3"} ]; objalignment = [ {texto:"MS_ALIGN_LEFT",valor:"0"}, {texto:"MS_ALIGN_CENTER",valor:"1"}, {texto:"MS_ALIGN_RIGHT",valor:"2"} ]; YAHOO.namespace("example.container"); function initMenu() { ativaBotaoAdicionaMapfile("adiciona") core_carregando("ativa"); core_carregando("buscando temas..."); core_ativaPainelAjuda("ajuda","botaoAjuda"); core_pegaMapfiles("montaArvore()") } function ativaBotaoAdicionaMapfile(idBotao) { var adiciona = function() { core_montaEditor("adicionaNovoMapfile()") ins = "
Título do novo tema:
" ins += "" ins += "Nome do arquivo mapfile (sem .map):
" ins += "" $i("editor_bd").innerHTML = ins }; //cria o botão de adição de um novo menu var adiciona = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } }); } function montaArvore() { YAHOO.example.treeExample = new function() { var currentIconMode; tree = ""; function changeIconMode() { var newVal = parseInt(this.value); if (newVal != currentIconMode) {currentIconMode = newVal;} buildTree(); } function loadNodeData(node, fnLoadComplete) { var sUrl = "../php/editormapfile.php?funcao=pegaLayers&codigoMap="+node.data.codigoMap; var callback = { success: function(oResponse) { var dados = YAHOO.lang.JSON.parse(oResponse.responseText) montaRaizTema(node,dados) oResponse.argument.fnLoadComplete(); }, failure: function(oResponse) { oResponse.argument.fnLoadComplete(); }, argument: { "node": node, "fnLoadComplete": fnLoadComplete }, timeout: 25000 }; YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); } function buildTree() { tree = new YAHOO.widget.TreeView("tabela"); tree.setDynamicLoad(loadNodeData, currentIconMode); var root = tree.getRoot(); var tempNode = new YAHOO.widget.TextNode('', root, false); tempNode.isLeaf = true; core_carregando("desativa"); } buildTree(); }(); montaNosRaiz("nao") tree.draw(); } function montaNosRaiz(redesenha) { var root = tree.getRoot(); var nos = new Array() for (var i=0, j=$mapfiles.length; iItens encontrados na tabela de atributos do layer. Escolha um deles para ser utilizado na expressão de seleção de cada classe
" ins += "" $i("editor_bd").innerHTML = ins; core_carregando("desativa"); } catch(e){core_handleFailure(o,o.responseText);core_carregando("desativa");} }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } }; core_makeRequest(sUrl,callback) } YAHOO.example.container.panelEditorAutoClasses.show(); } function adicionaNovoEstilo(codigoMap,codigoLayer,indiceClasse) { core_carregando("ativa"); core_carregando(" adicionando um novo estilo"); sUrl = "../php/editormapfile.php?funcao=criarNovoEstilo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse var callback = { success:function(o) { try { if(YAHOO.lang.JSON.parse(o.responseText) == "erro") { core_carregando("Erro"); setTimeout("core_carregando('desativa')",3000) } else { var dados = YAHOO.lang.JSON.parse(o.responseText) var no = tree.getNodeByProperty("id",codigoMap+"_"+codigoLayer+"_"+indiceClasse) montaParametrosClasses(no,dados) core_carregando("desativa"); } } catch(e){core_handleFailure(e,o.responseText);} }, failure:core_handleFailure, argument: { foo:"foo", bar:"bar" } }; core_makeRequest(sUrl,callback) } function excluirMapfile(codigoMap) { var mensagem = " excluindo "+codigoMap; var no = tree.getNodeByProperty("id",codigoMap) var sUrl = "../php/editormapfile.php?funcao=excluirMapfile&codigoMap="+codigoMap; core_excluiNoTree(sUrl,no,mensagem) } function excluirLayer(codigoMap,codigoLayer) { var mensagem = " excluindo "+codigoLayer; var no = tree.getNodeByProperty("id",codigoMap+"_"+codigoLayer) var sUrl = "../php/editormapfile.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; core_excluiNoTree(sUrl,no,mensagem) } function excluirClasse(codigoMap,codigoLayer,indiceClasse) { var handleYes = function() { this.hide(); core_carregando("ativa"); var mensagem = " excluindo "+indiceClasse; core_carregando(mensagem); var sUrl = "../php/editormapfile.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse; var callback = { success:function(o) { try { var dados = YAHOO.lang.JSON.parse(o.responseText) var nos = tree.getNodesByProperty("classes",codigoMap+"_"+codigoLayer) for (var i=0, j=nos.length; iOs seguintes 'alias' estão disponíveis para uso na opção 'connection': "; ins += dados.postgis_mapa+"
" } ins += "" ins += core_geraLinhas(param) ins += "" $i("cConnectiontype").innerHTML = temp var temp = function() {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,false)} new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); var temp = function() {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,"","",true)} new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); } function montaEditorMetadados(dados) { var param = { "linhas":[ {ajuda:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", titulo:"Tema",id:"tema",value:dados.tema,tipo:"text"}, {ajuda:"Denominador da escala da fonte dos dados utilizado pelo tema. É utilizado para apresentar a indicação de compatibilidade entre a escala do tema e a escala do mapa que está sendo visto.", titulo:"Escala",id:"escala",value:dados.escala,tipo:"text"}, {ajuda:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", titulo:"Extensao",id:"extensao",value:dados.extensao,tipo:"text"}, {ajuda:"Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa", titulo:"Aplica extensao",id:"",value:dados.aplicaextensao,tipo:"text",div:"
"}, {ajuda:"Indica se o usuário pode fazer download do tema", titulo:"Download",id:"",value:dados.download,tipo:"text",div:""}, {ajuda:"Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM.", titulo:"Classe",id:"",value:dados.classe,tipo:"text",div:""}, {ajuda:"Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'", titulo:"Escondido",id:"",value:dados.escondido,tipo:"text",div:""}, {ajuda:"Indica se o tema irá ser mostrado na ferramenta de identificação", titulo:"Identifica",id:"",value:dados.identifica,tipo:"text",div:""}, {ajuda:"Nomes das colunas da tabela de atributos do tema, que serão mostradas na ferramenta de identificação. Se for vazio, todas as colunas serão mostradas. A lista de itens deve ser separada por ',' e grafada em caixa alta no caso de shapefile.", titulo:"Itens",id:"itens",value:dados.itens,tipo:"text"}, {ajuda:"Lista com os 'alias', ou apelidos, para os nomes das colunas listados no metadata 'itens'. Os alias devem ser separados por ',' e seguir a ordem definida em ITENS.", titulo:"Itensdesc",id:"itensdesc",value:dados.itensdesc,tipo:"text"}, {ajuda:"Lista de links que serão incluídos em cada resultado de busca da ferramenta de identificação. A lista de links deve ser separada por ',', podendo-se incluir '' para indicar que o item não tem link. Exemplo de uso para inclusão de links para o site do IBGE quando um município é clicado no mapa:O layer possuí as seguintes colunas na tabela de atributos: "; ins += dados.colunas+"
" } ins += core_geraLinhas(param) ins += "" $i("cAplicaextensao").innerHTML = temp temp = "
" $i("cDownload").innerHTML = temp temp = "
" $i("cClasse").innerHTML = temp temp = "
" $i("cEscondido").innerHTML = temp temp = "
" $i("cIdentifica").innerHTML = temp var temp = function() {salvarDadosEditor('metadados',dados.codigoMap,dados.codigoLayer)} new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); } function montaEditorGeral(dados) { var param = { "linhas":[ {ajuda:"Layer name", titulo:"Name",id:"name",value:dados.name,tipo:"text"}, {ajuda:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", titulo:"Group",id:"group",value:dados.group,tipo:"text"}, {ajuda:"Projeção", titulo:"Projection",id:"projection",value:dados.projection,tipo:"text"}, {ajuda:"Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently", titulo:"Status",id:"",value:dados.status,tipo:"text",div:"
"}, {ajuda:"Specifies how the data should be drawn. Need not be the same as the shapefile type. For example, a polygon shapefile may be drawn as a point layer, but a point shapefile may not be drawn as a polygon layer. Common sense rules. Annotation means that a label point will be calculated for the features, but the feature itself will not be drawn although a marker symbol can be optionally drawn. this allows for advanced labeling like numbered highway shields. Points are labeled at that point. Polygons are labeled first using a centroid, and if that doesn't fall in the polygon a scanline approach is used to guarantee the label falls within the feature. Lines are labeled at the middle of the longest arc in the visible portion of the line. Query only means the layer can be queried but not drawn.In order to differentiate between POLYGONs and POLYLINEs (which do not exist as a type), simply respectively use or ommit the COLOR keyword when classifying. If you use it, it's a polygon with a fill color, otherwise it's a polyline with only an OUTLINECOLOR.For CHART layers, see the Dynamic Charting howto.A circle must be defined by a a minimum bounding rectangle. That is, 2 points that define the smallest square that can contain it. These 2 points are the two opposite corners of said box", titulo:"Type",id:"",value:dados.type,tipo:"text",div:""}, {ajuda:"Sets the color index to treat as transparent for raster layers.", titulo:"Offsite (R,G,B) (utilize -1,-1,-1 para anular o valor)",id:"offsite",value:dados.offsite,tipo:"text"}, {ajuda:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", titulo:"Opacity",id:"opacity",value:dados.opacity,tipo:"text"}, {ajuda:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", titulo:"Maxscale (utilize -1 para anular o valor)",id:"maxscale",value:dados.maxscale,tipo:"text"}, {ajuda:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", titulo:"Minscale (utilize -1 para anular o valor)",id:"minscale",value:dados.minscale,tipo:"text"}, {ajuda:"This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. For OGR and shapefiles the string is simply a mapserver regular expression. For spatial databases the string is a SQL WHERE clause that is valid with respect to the underlying database.For example: FILTER type='road' and size <2", titulo:"Filter",id:"filter",value:dados.filter,tipo:"text"}, {ajuda:"Item to use with simple FILTER expressions. OGR and shapefiles only.", titulo:"Filteritem",id:"filteritem",value:dados.filteritem,tipo:"text"}, {ajuda:"Item name in attribute table to use for class annotation (i.e. labeling).", titulo:"Labelitem",id:"labelitem",value:dados.labelitem,tipo:"text"}, {ajuda:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", titulo:"Labelmaxscale (utilize -1 para anular o valor)",id:"labelmaxscale",value:dados.labelmaxscale,tipo:"text"}, {ajuda:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", titulo:"Labelminscale (utilize -1 para anular o valor)",id:"labelminscale",value:dados.labelminscale,tipo:"text"}, {ajuda:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", titulo:"Symbolscale (utilize -1 para anular o valor)",id:"symbolscale",value:dados.symbolscale,tipo:"text"}, {ajuda:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", titulo:"Tolerance",id:"tolerance",value:dados.tolerance,tipo:"text"}, {ajuda:" ", titulo:"Tolerance units",id:"",value:dados.toleranceunits,tipo:"text",div:""}, {ajuda:"Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering", titulo:"Sizeunits",id:"",value:dados.sizeunits,tipo:"text",div:""} ] } var ins = "" ins += "" if(dados.colunas != "") { ins += "O layer possuí as seguintes colunas na tabela de atributos: "; ins += dados.colunas+"
" } ins += core_geraLinhas(param) ins += "" $i("cStatus").innerHTML = temp temp = "
" $i("cType").innerHTML = temp temp = "
" $i("cSizeunits").innerHTML = temp temp = "
" $i("cToleranceunits").innerHTML = temp var temp = function() {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,false)} new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); var temp = function() {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,"","",true)} new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); } function montaEditorClasseGeral(dados) { var re = /C_/g; dados.expression = dados.expression.replace(re,"]"); var re = /_C/g; dados.expression = dados.expression.replace(re,"["); var re = /_A_/g; dados.expression = dados.expression.replace(re,"'"); var param = { "linhas":[ {ajuda:"Nome da classe para ser mostrada na legenda", titulo:"Name",id:"name",value:dados.name,tipo:"text"}, {ajuda:"Sets the current display status of the class. Default turns the class on", titulo:"Status",id:"",value:dados.status,tipo:"text",div:"
"}, {ajuda:"Four types of expressions are now supported to define class membership. String comparisons, regular expressions, simple logical expressions, and string functions. If no expression is given, then all features are said to belong to this class.O layer possuí as seguintes colunas na tabela de atributos: "; ins += dados.colunas+"
" } ins += core_geraLinhas(param) ins += "" $i("cStatus").innerHTML = temp var temp = function() {salvarDadosEditor('classeGeral',dados.codigoMap,dados.codigoLayer,dados.indiceClasse)} new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); } function montaEditorClasseLabel(dados) { var param = { "linhas":[ {ajuda:"Color to draw text with.", titulo:"Color",id:"color",value:dados.color,tipo:"cor"}, {ajuda:"Text size. Use integer to give the size in pixels of your TrueType font based label, or any of theother 5 listed keywords to bitmap fonts.", titulo:"Size",id:"size",value:dados.size,tipo:"text"}, {ajuda:"Position of the label relative to the labeling point (layers only). First letter is Y position, second letter is X position. Auto tells MapServer to calculate a label position that will not interfere with other labels. With points and polygons, MapServer selects from the 8 outer positions (i.e. excluding cc). With lines, it only uses lc or uc, until it finds a position that doesn't collide with labels that have already been drawn. If all positions cause a conflict, then the label is not drawn (Unless the label's FORCE a parameter is set to true). Auto placement is only available with cached labels.", titulo:"Position",id:"position",value:dados.position,tipo:"text"}, {ajuda:"Padding, in pixels, around labels. Useful for maintaining spacing around text to enhance readability. Available only for cached labels. Default is 0.", titulo:"Buffer",id:"buffer",value:dados.buffer,tipo:"text"}, {ajuda:"Font alias (as defined in the FONTSET) to use for labeling", titulo:"Font",id:"",value:dados.font,tipo:"text",div:"
"}, {ajuda:"Type of font to use. Generally bitmap fonts are faster to draw then TrueType fonts. However,TrueType fonts are scalable and available in a variety of faces. Be sure to set the FONT parameter ifyou select TrueType", titulo:"Type",id:"",value:dados.type,tipo:"text",div:""}, {ajuda:"Can text run off the edge of the map? Default is true", titulo:"Partials",id:"",value:dados.partials,tipo:"text",div:""}, {ajuda:"Forces labels for a particular class on, regardless of collisions. Available only for cached labels. Default is false.", titulo:"Force",id:"",value:dados.force,tipo:"text",div:""}, {ajuda:"Color to draw a background rectangle (i.e. billboard). Off by default.", titulo:"Backgroundcolor",id:"backgroundcolor",value:dados.backgroundcolor,tipo:"cor"}, {ajuda:"Color to draw a background rectangle (i.e. billboard) shadow. Off by default.", titulo:"Backgroundshadowcolor",id:"backgroundshadowcolor",value:dados.backgroundshadowcolor,tipo:"cor"}, {ajuda:"Color to draw a one pixel outline around the text.", titulo:"Outlinecolor",id:"outlinecolor",value:dados.outlinecolor,tipo:"cor"}, {ajuda:"Color of drop shadow.", titulo:"Shadowcolor",id:"shadowcolor",value:dados.shadowcolor,tipo:"text"}, {ajuda:"Shadow offset in pixels.", titulo:"Shadowsizex",id:"shadowsizex",value:dados.shadowsizex,tipo:"text"}, {ajuda:"Shadow offset in pixels.", titulo:"Shadowsizey",id:"shadowsizey",value:dados.shadowsizey,tipo:"text"}, {ajuda:"How far should the background rectangle be offset? Default is 1.", titulo:"Backgroundshadowsizex",id:"backgroundshadowsizex",value:dados.backgroundshadowsizex,tipo:"text"}, {ajuda:"How far should the background rectangle be offset? Default is 1.", titulo:"Backgroundshadowsizey",id:"backgroundshadowsizey",value:dados.backgroundshadowsizey,tipo:"text"}, {ajuda:"Minimum font size to use when scaling text (pixels). Default is 4.", titulo:"Minsize",id:"minsize",value:dados.minsize,tipo:"text"}, {ajuda:"Maximum font size to use when scaling text (pixels). Default is 256.", titulo:"Maxsize",id:"maxsize",value:dados.maxsize,tipo:"text"}, {ajuda:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", titulo:"Offsetx",id:"offsetx",value:dados.offsetx,tipo:"text"}, {ajuda:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", titulo:"Offsety",id:"offsety",value:dados.offsety,tipo:"text"}, {ajuda:"Angle, given in degrees, to draw the label or AUTO to allow the software to compute the angle, AUTO is valid for LINE layers only. FOLLOW was introduced in version 4.10 and tells map server to compute a curved label for appropriate linear features", titulo:"Angle (utilize MS_FOLLOW para textos curvos)",id:"angle",value:dados.angle,tipo:"text"}, {ajuda:"Cálculo automático do ângulo quando os elementos forem lineares", titulo:"Autoangle",id:"",value:dados.angle,tipo:"text",div:""}, {ajuda:"Should text be antialiased? Note that this requires more available colors, decreased drawing performance, and results in slightly larger output images.", titulo:"Antialias",id:"antialias",value:dados.antialias,tipo:"text"}, {ajuda:"Character that represents an end-of-line condition in label text, thus resulting in a multi-line label.", titulo:"Wrap",id:"wrap",value:dados.wrap,tipo:"text"}, {ajuda:"Minimum size a feature must be to be labeled. Given in pixels. For line data the overall length of the displayed line is used, for polygons features the smallest dimension of the bounding box is used. Auto keyword tells MapServer to only label features that are larger than their corresponding label. Available for cached labels only.", titulo:"Minfeaturesize",id:"minfeaturesize",value:dados.minfeaturesize,tipo:"text"}, {ajuda:"Minimum distance between duplicate labels. Given in pixels.", titulo:"Mindistance",id:"mindistance",value:dados.mindistance,tipo:"text"}, {ajuda:"Supported encoding format to be used for labels. If the format is not supported, the label will not be drawn. Requires the iconv library (present on most systems). The library is always detected if present on the system, but if not the label will not be drawn. Required for displaying international characters in MapServer. More information can be found at: http://www.foss4g.org/FOSS4G/MAPSERVER/mpsnf-i18n-en.html.", titulo:"Encoding",id:"encoding",value:dados.encoding,tipo:"text"} ] } var ins = "" if(dados.colunas != "") { ins += "O layer possuí as seguintes colunas na tabela de atributos: "; ins += dados.colunas+"
" } ins += core_geraLinhas(param) ins += "" $i("cFont").innerHTML = temp temp = "
" $i("cType").innerHTML = temp temp = "
" $i("cPartials").innerHTML = temp temp = "
" $i("cForce").innerHTML = temp temp = "
"
$i("cAutoangle").innerHTML = temp
var temp = function()
{salvarDadosEditor('classeLabel',dados.codigoMap,dados.codigoLayer,dados.indiceClasse)}
new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});
}
function montaEditorEstilo(dados)
{
var param = {
"linhas":[
{ajuda:"The symbol name or number to use for all features if attribute tables are not used. The number is the index of the symbol in the symbol file, starting at 1, the 5th symbol in the file is therefore symbol number 5. You can also give your symbols names using the NAME keyword in the symbol definition file, and use those to refer to them. Default is 0, which results in a single pixel, single width line, or solid polygon fill, depending on layer type.You can also specify a gif or png filename. The path is relative to the location of the mapfile.",
titulo:"Symbolname",id:"symbolname",value:dados.symbolname,tipo:"text"},
{ajuda:"Color to use for drawing features.",
titulo:"Color",id:"color",value:dados.color,tipo:"cor"},
{ajuda:"Background-color to use for drawing features.",
titulo:"Backgroundcolorolor",id:"backgroundcolor",value:dados.backgroundcolor,tipo:"cor"},
{ajuda:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.",
titulo:"Size",id:"size",value:dados.size,tipo:"text"},
{ajuda:"Color to use for outlining polygons and certain marker symbols. Line symbols do not support outline colors.",
titulo:"Outlinecolor",id:"outlinecolor",value:dados.outlinecolor,tipo:"cor"},
{ajuda:"Width refers to the thickness of line work drawn, in pixels. Default is 1. For symbols of Type HATCH, the WIDTH is how thick the hatched lines are. For its use with hatched lines, see Example#8 in the SYMBOL examples.",
titulo:"Width",id:"width",value:dados.width,tipo:"text"},
{ajuda:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.",
titulo:"Minsize",id:"minsize",value:dados.minsize,tipo:"text"},
{ajuda:"Maximum size in pixels to draw a symbol. Default is 50.",
titulo:"Maxsize",id:"maxsize",value:dados.maxsize,tipo:"text"},
{ajuda:"Offset values for shadows, hollow symbols, etc ...",
titulo:"Offsetx",id:"offsetx",value:dados.offsetx,tipo:"text"},
{ajuda:"Offset values for shadows, hollow symbols, etc ...",
titulo:"Offsety",id:"offsety",value:dados.offsety,tipo:"text"},
{ajuda:"Should TrueType fonts and Cartoline symbols be antialiased.",
titulo:"Antialias",id:"antialias",value:dados.antialias,tipo:"text"},
{ajuda:"Minimum width in pixels to draw the line work.",
titulo:"Minwidth",id:"minwidth",value:dados.minwidth,tipo:"text"},
{ajuda:"Maximun width in pixels to draw the line work.",
titulo:"Maxwidth",id:"maxwidth",value:dados.maxwidth,tipo:"text"},
{ajuda:"Angle, given in degrees, to draw the line work. Default is 0. For symbols of Type HATCH, this is the angle of the hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.",
titulo:"Angle",id:"angle",value:dados.angle,tipo:"text"}
]
}
var ins = ""
ins += core_geraLinhas(param)
ins += "
"
$i("editor_bd").innerHTML = ins
var temp = function()
{salvarDadosEditor('estilo',dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.indiceEstilo)}
new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});
}
function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar)
{
if(arguments.length < 6){var testar = false;}
if(tipo == "conexao")
{
var campos = new Array("connection","data","connectiontype","tileitem","tileindex")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer
var prog = "../php/editormapfile.php?funcao=alterarConexao"
}
if(tipo == "metadados")
{
//
//validação
//
var valorTeste = $i("extensao").value
var teste1 = valorTeste.split(" ");
if(teste1.length != 4)
{alert("Sao necessarios 4 valores em extensao");return;}
if(teste1[0]*1 > teste1[2]*1)
{alert("xmin maior que xmax em extensao");return;}
if(teste1[1]*1 > teste1[3]*1)
{alert("ymin maior que ymax em extensao");return;}
var valorTeste = $i("escala").value
if(valorTeste != ""){
var teste1 = valorTeste * 1;
if(teste1 > 0){}
else
{alert("Valor de escala incorreto");return;}
}
var campos = new Array("aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","mensagem","identifica","extensao","escondido","download","escala","tema","classe","tip","itenslink","itens","itensdesc")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer
var prog = "../php/editormapfile.php?funcao=alterarMetadados"
}
if(tipo == "geral")
{
var campos = new Array("name","projection","sizeunits","status","toleranceunits","tolerance","symbolscale","opacity","offsite","minscale","maxscale","labelminscale","labelmaxscale","labelitem","group","filteritem","type","filter")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer
var prog = "../php/editormapfile.php?funcao=alterarGeral"
}
if(tipo == "classeGeral")
{
var campos = new Array("status","minscale","maxscale","name","keyimage")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse
var temp = $i("expression").value;
var re = /]/g;
var temp = temp.replace(re,"C_");
var re = "[";
var temp = temp.replace(re,"_C");
var re = /'/g;
var temp = temp.replace(re,"_A_");
par += "&expression="+temp;
var prog = "../php/editormapfile.php?funcao=alterarClasseGeral"
}
if(tipo == "classeLabel")
{
var campos = new Array("encoding","force","partials","mindistance","minfeaturesize","wrap","antialias","buffer","autoangle","angle","offsety","offsetx","position","maxsize","minsize","size","backgroundshadowsizey","backgroundshadowsizex","shadowsizey","shadowsizex","shadowcolor","outlinecolor","color","backgroundshadowcolor","backgroundcolor","type","font")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse
var prog = "../php/editormapfile.php?funcao=alterarClasseLabel"
}
if(tipo == "estilo")
{
var campos = new Array("angle","maxwidth","minwidth","width","outlinecolor","backgroundcolor","antialias","offsety","offsetx","maxsize","minsize","size","color","symbolname")
var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse+"&indiceEstilo="+indiceEstilo
var prog = "../php/editormapfile.php?funcao=alterarEstilo"
}
prog += "&testar="+testar;
for (i=0;i