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

Jamie jamiee at email.cz
Thu Aug 2 06:20:03 EDT 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20070802/6deec77e/attachment.html


More information about the ka-Map-users mailing list