setting view point

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

setting view point

Post by hproe »

Hi -

I am not sure whether this is a bug or my problem. I have tried to set the view point of a panel in this way (code snippet):

Code: Select all

 panel=buildWindow(height=600,width=600,panelTypes=GLOBE)
 panel(0).setViewpoint('Asia')

This issues the following message:
Traceback (most recent call last):
File "", line 1, in <modules>
File "", line nn, in code
TypeError: 'list' object is not callable

setViewpoint() is not working with panel type MAP either.

An additional question. Would it be possible to navigate the panel (both MAP and GLOBE) explicitly through coordinates etc, without having to define a view point beforehand?

HP
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: setting view point

Post by bobc »

Hi HP -

For your error message you are seeing with setViewpoint, does it help if you use square brackets after 'panel' instead of parentheses?

Ex:
not: panel(0).setViewpoint('Asia')
but... panel[0].setViewpoint('Asia')

Thanks -
Bob Carp
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: setting view point

Post by bobc »

Hi again HP -

As for the second part of your post:

An additional question. Would it be possible to navigate the panel (both MAP and GLOBE) explicitly through coordinates etc, without having to define a view point beforehand?

I believe setCenter would work well for you. This allows you to define latitude, longitude and scale (zoom) values for where to center your display. For example:

Code: Select all

panel=buildWindow(height=800,width=800,panelTypes=GLOBE)
panel[0].setCenter(lat=44,lon=-89,scale=15)

... will build a window, and canter the display at 44/-89 zoomed in. Note that this setCenter is working well in the most recent nightly (there had been an issue where the display didn't center correctly from the lat/lon entered in setCenter).

If this doesn't satisfy your request, please let us know.

Thanks -
Bob Carp
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

Re: setting view point

Post by hproe »

Many thanks Bob. It is the square brackets! And the setCenter() is welcome as well. Sorry, I should have recalled these details.

HP
Post Reply