[ka-Map-users] position discrepancy

Paul Spencer pspencer at dmsolutions.ca
Tue Mar 21 11:59:25 EST 2006


Laurent,

sorry for the delay.  kaMap (by default) positions objects with the  
top, left corner of the img at the position you have requested.  To  
modify the position, you can set xOffset and yOffset on your img  
before adding it.  xOffset and yOffset are typically negative numbers  
and are pixel offsets from the top left corner.

For instance, to center an image, you might do:

var img = document.createElement('img');
img.width=20;
img.height=20;
img.src = 'images/house.png';
img.xOffset = -10;
img.yOffset = -10;

myKaMap.addObjectGeo(canvas, lon, lat, img );

The other factor is how mapserver is positioning the symbol.  You  
should make sure that it is centering the star on the point rather  
than using some other position (not sure about how to do this but I  
know it can be done, see mapserver site for reference)

This should solve most of the discrepancy

Cheers

Paul

On 17-Mar-06, at 4:53 AM, Laurent PIERRE wrote:

> pspencer at dmsolutions.ca a écrit :
>
>> Hi,
>>
>> it is most likely an accuracy problem either in the calculations   
>> (because they are pixel based, some rounding happens) or your  
>> data  (perhaps differing projections?  A datum shift can easily  
>> cause  discrepancies of 200m in some cases)
>>
>> Cheers
>>
>> Paul
>>
>> On 15-Mar-06, at 10:00 AM, Laurent PIERRE wrote:
>>
>>> Hi,
>>>
>>> I 'v just finished to develop a web site with ka_map (0.2) (in  
>>> my  opinion a very good framework to produce appealing web  
>>> mapping  applications ... thanks to developpers) and I figured  
>>> out that the  localisation of objects created on maps have a  
>>> small dicrepancy  with the actual x y given to 'addObj' (about 50  
>>> m). Is it a known  issue of Ka_map ?
>>>
>>> Thanks
>>>
>>> Laurent Pierre
>>> EDF R&D
>>>
>>>
>>> _______________________________________________
>>>
>>
> To be sure, I defined a point by 2 ways (using the same SR) :
> - with Ka-map addObj -> small yellow and blue house
> - mapserver mapfile       -> red star
>
> I join the resulting (1:25 000)  map
>
>
> Cheers
>
> <disc.png>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+







More information about the ka-Map-users mailing list