Ticket #2053 (closed defect: invalid)
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
Note: See
TracTickets for help on using
tickets.
