[ka-Map-users] Adding International character support for layer

Suvi Mikkola suvi.mikkola at gmail.com
Thu Aug 2 07:20:51 EDT 2007


Thanks Jamie:)

I have also a problem with class name, but a different one. I have
some very long names, and I would like to display them in two or more
rows in legend.. now they're only in one row and the user must scroll
to see the whole name. In my opinion, scrolling==frustrating. Any idea
how this should be done?

BR,
Suvi

On 8/2/07, Jamie <jamiee at email.cz> wrote:
> Hey all,
> if anybody still need help with "Adding International character support for
> layer name" here is a little advice.
> 1. in *.map file
>  e.g: LAYER
>  NAME "Province"
>  GROUP "Province" (groupname in English)
>  STATUS DEFAULT
>  DATA ...
>  TYPE POLYGON
>  METADATA
>  "OPACITY" "50"
>  "group_title" "Chinese name" * (in Chinese)
>
>  END
>  ...
>
> 2. in kamap.js file
> function _layer( o ) {
>  this.domObj = null;
>  this._map = null;
>  this.name = (typeof(o.name) != 'undefined') ? o.name : 'unnamed';
>  this.visible = (typeof(o.visible) != 'undefined') ? o.visible : true;
>  this.opacity = (typeof(o.opacity) != 'undefined') ? o.opacity : 100;
>
>  this.title = (typeof(o.title) != 'undefined') ? o.title : 'unnamed';
>                                      /* Add this row */
>
>  this.imageformat = (typeof(o.imageformat) != 'undefined') ? o.imageformat :
> null;
>  this.queryable = (typeof(o.queryable) != 'undefined') ? o.queryable :
> false;
>  this.queryState = (typeof(o.queryable) != 'undefined') ? o.queryable :
> false;
>  this.tileSource = (typeof(o.tileSource) != 'undefined') ? o.tileSource :
> 'auto';
>  this.scales = (typeof(o.scales) != 'undefined') ? o.scales : new
> Array(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
>  this.toLoad=0;
>
> 3. in init.php file
>  /* detect layer opacity (default 100% opaque) */
>  $opacity = $oLayer->getMetaData('opacity');
>  if ($opacity == '') {
>  $opacity = 100;
>  }
>
>  $title = $oLayer->getMetadata('group_title');
>                                                            /*add this row*/
>
>  /* detect tile source options (cache, redraw, nocache, or auto) */
>  $tileSource =
> strtolower($oLayer->getMetaData('tile_source'));
>  if(($tileSource != 'cache') && ($tileSource != 'redraw') && ($tileSource !=
> 'refresh') && ($tileSource != 'nocache')) {
>  $tileSource = 'auto';
>  }
>
>
> and
>
>  "opacity:".$opacity.",".
>
>  "title:'".$title."',".
>                                                                /* add this
> row*/
>
>  "imageformat:'".$imageformat."',".
>
> 4. in KaLegend.js file
> insted "td.innerHTML = name;" (maybe row number 409)
> place „td.innerHTML = oLayer.title;"
>
> That's all
>
>
> Can anybody help me with "Adding International character support for class
> name" please?
>
> Have a nice time with Ka-Map Jamie
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>



More information about the ka-Map-users mailing list