[Chameleon] Rounding scale value
John Pulles
john.pulles at geodan.nl
Tue Apr 4 04:34:17 EDT 2006
Eijnden, B. van den (Bart) schreef:
>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?
>
>
Hi Bart,
Recent versions of Javascript have functions like toPrecision() and
toFixed().
Groeten,
John.
>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.
>************************************************************************
>
>_______________________________________________
>Chameleon mailing list
>Chameleon at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/chameleon
>
>
>
>
>
--
John Pulles
-------------------------------------
Geodan IT b.v.
Buitenhaven 27-A
5211TP 's-Hertogenbosch
-------------------------------------
Tel: +31 (0)73 - 692 5151
Fax: +31 (0)73 - 692 5150
-------------------------------------
Postadres / mailing address
President Kennedylaan 1
1079MB Amsterdam
-------------------------------------
E-mail: john.pulles at geodan.nl
Website: http://www.geodan.nl
-------------------------------------
More information about the Chameleon
mailing list