Ticket #2053 (closed defect: invalid)

Opened 6 years ago

Last modified 6 years ago

zoomPoint failure when called in separate method

Reported by: janc44@… Owned by: unicoletti
Priority: high Milestone:
Component: MapScript-Java Version: unspecified
Severity: normal Keywords:
Cc:

Description

I am using the mapscript libraries that came with the current ms4w package.
When I use the zoomPoint method like this and 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);
	}

Change History

Changed 6 years ago by unicoletti

  • status changed from new to closed
  • resolution set to invalid

Sorry for the late reply, but bugzilla has been unavailable for some time.

Zoom is wrong because you have swapped width and height in the zoomToPoint method.

Note: See TracTickets for help on using tickets.