[Chameleon] Rounding scale value

Eijnden, B. van den (Bart) b.vdeijnden at agi.rws.minvenw.nl
Tue Apr 4 03:55:16 EDT 2006


We could use a widget attribute named round for the Scale widget with
possible values true/false, default false.

But maybe some more control would be desirable, so a precision attribute
with a default value of -1 which means just the way it works now, and for
your situation a value of 0.

Last time I checked I had a bit of trouble finding good javascript functions
which could change numeric values to a certain precision, are you familiar
with any?

Best regards,
Bart

-----Oorspronkelijk bericht-----
Van: Gambin Dejan [mailto:Dejan.Gambin at pula.hr]
Verzonden: dinsdag 4 april 2006 9:53
Aan: Eijnden, B. van den (Bart)
CC: chameleon at lists.maptools.org
Onderwerp: RE: [Chameleon] Rounding scale value


I have tried nad it seems it work for me...but I just modified this
piece of code because I am just interested in showing the scale value
without any decimal points. I suppose you are interested in adding a new
parameter in a widget...

regards, dejan

> -----Original Message-----
> From: Eijnden, B. van den (Bart) 
> [mailto:b.vdeijnden at agi.rws.minvenw.nl] 
> Sent: Tuesday, April 04, 2006 9:26 AM
> To: Gambin Dejan
> Cc: chameleon at lists.maptools.org
> Subject: RE: [Chameleon] Rounding scale value
> 
> 
> Hi Dejan,
> 
> I think this might work, give it a try and please report back. Thanks.
> 
> Best regards,
> Bart
> 
> -----Oorspronkelijk bericht-----
> Van: Gambin Dejan [mailto:Dejan.Gambin at pula.hr]
> Verzonden: dinsdag 4 april 2006 9:26
> Aan: Eijnden, B. van den (Bart)
> CC: chameleon at lists.maptools.org
> Onderwerp: RE: [Chameleon] Rounding scale value
> 
> 
> Hi Bart,
> 
> Can you tell me where the form variable (SCALE) is used in 
> calculations in JSAPI mode? If I can see it is used only in:
> 
> "goCWCJSAPI.oMap.oApplication.ZoomToScale({$this->mszHTMLForm}
> .SCALE.val
> ue);"
> 
> If this is true, may I just 
> put:"goCWCJSAPI.oMap.oApplication.ZoomToScale(goCWCJSAPI.oMap.scale);"
> instead of above and use something like:
> 
> "{$this->mszHTMLForm}.SCALE.value = 
> Math.round(goCWCJSAPI.oMap.scale);"
> for displaying the rounded scale?
> 
> regards, dejan
> 
> > -----Original Message-----
> > From: Eijnden, B. van den (Bart)
> > [mailto:b.vdeijnden at agi.rws.minvenw.nl] 
> > Sent: Tuesday, March 28, 2006 11:43 AM
> > To: Gambin Dejan; chameleon at lists.maptools.org
> > Subject: RE: [Chameleon] Rounding scale value
> > 
> > 
> > Hi Dejan,
> > 
> > I looked into the same problem a few months ago, but the
> > problem with rounding seems that all the calculations with 
> > the scale will also lose precision, so you need to decouple 
> > display from the raw values somehow.
> > 
> > If you find a solution, please update the following bug:
> > 
> > http://bugzilla.maptools.org/show_bug.cgi?id=1031
> > 
> > Best regards,
> > Bart
> > 
> > -----Oorspronkelijk bericht-----
> > Van: chameleon-bounces at lists.maptools.org
> > [mailto:chameleon-bounces at lists.maptools.org]Namens Gambin Dejan
> > Verzonden: dinsdag 28 maart 2006 10:36
> > Aan: chameleon at lists.maptools.org
> > Onderwerp: [Chameleon] Rounding scale value
> > 
> > 
> > Hi,
> > 
> > I am using Scale widget to display the scale. It is ok
> > initially but sometimes I get non-rounded value shown in the 
> > inputbox (like xxx.yyy) after zooming. I am using JSAPI. Do I 
> > have to round it somewhere in 
> > "{$this->mszHTMLForm}.SCALE.value = goCWCJSAPI.oMap.scale;"? 
> > I suppose I have to convert it to number first and then use 
> > riund function (or work with scale value as string)...
> > 
> > thanks
> > 
> > dejan
> > 
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
> > 
> > 
> > Disclaimer
> > **************************************************************
> > **********
> > Aan dit bericht kunnen geen rechten worden ontleend. Dit
> > bericht is uitsluitend bestemd voor de geadresseerde. Als u 
> > dit bericht per abuis hebt ontvangen, wordt u verzocht het te 
> > vernietigen en de afzender te 
> > informeren. Wij adviseren u om bij twijfel over de juistheid of de 
> > volledigheid van de mail contact met afzender op te nemen.
> > 
> > This message shall not constitute any rights or obligations.
> > This message is intended solely for the addressee. If you 
> > have received this message in error, please delete it and 
> > notify the sender immediately. When in doubt whether this 
> > message is correct or complete, please contact the sender.
> > **************************************************************
> > **********
> > 
> > 
> 
> 
> Disclaimer
> **************************************************************
> **********
> Aan dit bericht kunnen geen rechten worden ontleend. Dit 
> bericht is uitsluitend bestemd voor de geadresseerde. Als u 
> dit bericht per abuis hebt ontvangen, wordt u verzocht het te 
> vernietigen en de afzender te 
> informeren. Wij adviseren u om bij twijfel over de juistheid of de 
> volledigheid van de mail contact met afzender op te nemen.
> 
> This message shall not constitute any rights or obligations. 
> This message is intended solely for the addressee. If you 
> have received this message in error, please delete it and 
> notify the sender immediately. When in doubt whether this 
> message is correct or complete, please contact the sender.
> **************************************************************
> **********
> 
> 


Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the Chameleon mailing list