Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] How to set the scale denominator with Map Commands

>Von: Jody Garnett jgarnett@xxxxxxxxxxxxxxx
>> If I implement a new navigation command I have to update the
>> NavigationCommandFactory in my local udig environment. With the next
>> udig version I have the problem to fix it there again.
>You do not need to use the NavigationCommandFactory - if you are using
>your own command. The only reason we have a command factory is so uDig
>can change its implementations as time goes on with out breaking you.
>
>You are welcome to make a factory for your own commands, or simply use
>"new".

ok, but I wasn't successful

>> Von: Jesse Eichar jeichar@xxxxxxxxxxxxxxx
>> mailto:jeichar@xxxxxxxxxxxxxxx>
>>
>>     You will have to make your own NavCommand.  I think you extend
>>     AbstractNavCommand and make the following call in the run method:
>>
>>     map.getViewportModelInternal().setScaleDenominator( scale ).
>>
>>     Don't for get to add the undo functionality.
>>

The rendering process starts but ends with the same scaledenominator. The
logfile says why:

!ENTRY net.refractions.udig.project 1 0 2007-03-21 10:41:50.492 !MESSAGE
!STACK 0
java.lang.IllegalArgumentException: Latitude 96°15.0'S is out of range
(±90°).
at
org.geotools.referencing.GeodeticCalculator.checkLatitude(GeodeticCalculator.java:374)

at
org.geotools.referencing.GeodeticCalculator.setAnchorPoint(GeodeticCalculator.java:514)

at
net.refractions.udig.project.internal.render.impl.ViewportModelImpl.setScale(ViewportModelImpl.java:1193)

at de.foo.bar.ScaleCommand.runImpl(ScaleCommand.java:47)
at
net.refractions.udig.project.internal.command.navigation.AbstractNavCommand.run(AbstractNavCommand.java:48)

at
net.refractions.udig.project.command.CommandManager$Executor.execute(CommandManager.java:398)

at
net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:323)

at
net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:309)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

The map contained an boundingbox with
upper left: 95W,73N
lower right: 15E,2N
(north atlantic ocean with surrounding countries)
the scale is 1:35'587'761 and I want to set it to something like
1:12'000'000
this means I want to zoom in and the Latitude 96°15.0'S is not inside the
target bounding box.
I didn't try to understand the calculation in
ViewportModelImpl.setScale(..) but it looks like there is a bug inside.

tony roth



Back to the top