Oracle Maps - zooming in to a bounding box
571077Jun 19 2007 — edited Apr 24 2008I'm trying to get Oracle Maps to zoom in to my data when I bring up a map. I'm using the oraclemaps.js file that came with Mapviewer Ver10131_B061023 (I got this from the main page). I've tried several methods and none have worked.
I initially create a JDBC theme using the following Javascript code:
var query = "select target_geoms, label, attrs from targets where key=1";
var theme = "<themes><theme name=\"targets\">" +
"<jdbc_query datasource=\"grs\" jdbc_srid=\"8307\" " +
"spatial_column=\"target_geoms\" render_style=\"l.target_style\">" +
query +
"</jdbc_query></theme></themes>";
var t = new MVThemeBasedFOI("targets", theme);
mapview.addThemeBasedFOI(t);
mapview.display();
This code works just fine to display my theme using the default center and zoom levels.
I then tried two methods to zoom in to my theme. I tried putting the following statement before calling mapview.display():
t.setBoundingTheme(true);
I also tried putting the following statement after calling mapview.display():
t.zoomToTheme();
Both methods resulted in the following error in the OPMN logs:
WARN [oracle.sdovis.theme.DGTP] Scale definition for theme TARGETS is out of range.
I also tried "var sdogeom = t.getLayerMBR(); mapview.zoomToRectangle(sdogeom)", but this gives me a pop up error message of "Invalid rectangle coordinates". So I can only assume the getLayerMBR does not return a rectangle?
Can anyone tell me what the warning listed above means? The map cache zoom levels I have set up are large enough to cover the entire theme, and small enough to zoom in so that the entire theme is not visible. Or if anyone call tell me another method to try to set a bounding box around my JDBC theme.
Thanks!
Stephanie