Problem with zoomPoint()

Jan Ciriack janc44 at GMX.DE
Tue Mar 27 14:15:17 PDT 2007


Hi,
I am using the mapscript libraries that came with the current ms4w package.
Here is my problem:
When I use the zoomPoint method like this everything works fine:

	public static void main(String[] args) {

		mapObj map = new mapObj("global.map");
		pointObj point = new pointObj(300, 150, 0, 0);
			
			map.zoomPoint(
					2, 
					point, 
					map.getWidth(),
					map.getHeight(), 
					map.getExtent(),
					null);
		
			imageObj img = map.draw();
			img.save("worldmap.gif", map);
		
	}

But when put the call of zoomPoint in a separate method like this it zooms to a
different point than the one I specified.

	public static void main(String[] args) {
		
		mapObj map = new mapObj("global.map");
		pointObj point = new pointObj(300, 150, 0, 0);
		
		zoomToPoint(map, point, 2);
		imageObj img = map.draw();
		img.save("worldmap.gif", map);
		
	}

	public static void zoomToPoint(mapObj map, pointObj point, int mode) {
		map.zoomPoint(mode, point, map.getHeight(), map.getWidth(),map.getExtent(), null);
	}

It is quite weird, isn't it? The other zooming methods work okay.
Any help more than appreciated.
Cheers,
Jan



More information about the MapServer-users mailing list