[ka-Map-users] selectMap and zoomTo at same time
Adrian Strahan
adrian.strahan at usegis.co.uk
Tue Mar 21 09:04:50 EST 2006
Many thanks for the speedy response.
I'm using version 0.2-20060208
Here's the scenario:
All my maps are of different counties (so they don't overlap) and they're in
different projection systems (could this make a difference?).
When the user is browsing one county (say Map1), but then wants to view a
location in a different county (say Map2), I call something like this in
Javascript:
frames['myMapFrame'].document.kaCurrentTool.kaMap.selectMap("Map2");
frames['myMapFrame'].document.kaCurrentTool.kaMap.zoomTo(123456,567890);
What seems to happen is that the map changes to Map2 but the location is
completely wrong (could this be the right location but in Map1's
projection?).
I also get the following Javascript error:
Line: 207
Char: 2
Error: 'css.pixelWidth' is null or not an object
Code: 0
This appears to be in the wz_dragdrop.js file in the function dd.getDivW
It may be that kaMap isn't supposed to manage maps in different projection
systems like this?
But any further help would be most appreciated.
- Adrian
-----Original Message-----
From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
Sent: 21 March 2006 12:49
To: adrian.strahan at usegis.co.uk
Cc: ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] selectMap and zoomTo at same time
What version of ka-Map are you using? Looking at the current CVS
version, it doesn't seem like this should be a problem since
selectMap doesn't make an asynchronous call? Also, you could modify
the current extents of the map before calling selectMap to avoid the
zoomTo step:
var aMaps = myKaMap.getMaps();
for (var i=0; i<aMaps.length; i++) {
if (aMaps[i].name == theName) {
aMaps[i].setCurrentExtents(minx,miny,maxx,maxy);
myKaMap.selectMap(theName);
break;
}
}
Cheers
Paul
On 21-Mar-06, at 4:09 AM, Adrian Strahan wrote:
> Can anyone help me? - I'm trying to get KaMap to change map (using
> the selectMap function) and change location (using the zoomTo
> function) at the same time.
> But it seems that by the time the map has changed, the zoomTo
> function has been executed and is therefore ignored.
> I guess this is down to trying to call two asynchronous functions
> in a synchronous way using Javascript.
> Any help on this would be most appreciated.
>
> _______________________________________________
> 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