[ka-Map-users] coordinates
Paul Spencer
pspencer at dmsolutions.ca
Tue Aug 2 16:58:12 EDT 2005
Lorenzo,
in kaMap_pixToGeo, xOrigin and yOrigin are, in fact, initialized. You
must reference them as this.xOrigin instead of this.kaMap.xOrigin.
To get kaMap to use the xOrigin/yOrigin adjustments, you need to pass
true as the third argument.
Also, this code:
alert('gpx: '+gpx);
should be:
alert('gpx: '+gpX);
case-sensitivity!!!
Finally, you should do all this before calling slideBy as the pixToGeo
function may report invalid results depending on whether the slide has
started or not ... probably safer to do the conversion before that starts.
Cheers
Paul
Lorenzo Becchi wrote:
> Hi,
> I'm trying to trace mouse coordinates with kaMap CVS.
> I have no problems with local coordinates but big ones when I try to
> use: kaMap_pixToGeo and other functions that use xOrigin and yOrigin.
> it seems initialization doesn't set this parameters.
>
> test is here:
> http://149.139.8.29/~rischio/ka-map-cvs/ka-map/htdocs/
>
> on double click function (kaNavigator_ondblclick) I've put this code to
> show absolute coordinates below the scalebar.
> ---------------------------------------------------------
> var geoCoo = kaMap_pixToGeo(dx,dy);
> var gpX = geoCoo[0];
> var gpY = geoCoo[1];
>
> // Show x coordinates
> var span = getRawObject('x-position');
> span.innerHTML = gpX;
>
> // Show y coordinates
> var span = getRawObject('y-position');
> span.innerHTML = gpY;
> ---------------------------------------------------------
> any suggestions?
> thanks
> Lorenzo
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
--
+-----------------------------------------------------------------+
|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