[OpenLayers-Users] RegularPolygon radius document questions

杨华杰 yhjhoo at gmail.com
Tue Jan 29 00:11:50 PST 2013


can set up it individual? This is a global setting.


On Mon, Jan 28, 2013 at 6:45 PM, 杨华杰 <yhjhoo at gmail.com> wrote:

> nice, thank you very much, it help me a lot
>
>
> On Mon, Jan 28, 2013 at 4:38 PM, Grégory COLLIN <gcollin at v3d.fr> wrote:
>
>> Le Mon, 28 Jan 2013 08:15:48 +0100,
>> 杨华杰 <yhjhoo at gmail.com> a écrit :
>>
>> > Hi
>> >
>> > I have a question about the document.
>> >
>> > Here is the URL:
>> >
>> http://dev.openlayers.org/docs/files/OpenLayers/Handler/RegularPolygon-js.html#OpenLayers.Handler.RegularPolygon.setOptions
>> >
>> >
>> >
>> > The
>> > radius<
>> http://dev.openlayers.org/docs/files/OpenLayers/Handler/RegularPolygon-js.html#OpenLayers.Handler.RegularPolygon.radius
>> >
>> > explain as {Float} Optional radius in map units of the regular
>> > polygon.
>> >
>> >
>> > What's the unit? kilometer/meter/mile/NM?
>> >
>> >
>> > Regards,
>> > Hua Jie
>>
>> Hi Hua Jie,
>>
>> The units requested could be defined in the map object.
>>
>> So here is the code sample i used :
>>
>>   var map = new OpenLayers.Map({
>>        div: "map",
>>        theme: null,
>>        units: 'm',
>>        projection: "EPSG:900913",
>>        controls: [
>>          new OpenLayers.Control.Navigation({zoomWheelEnabled: false}),
>>          new OpenLayers.Control.NavToolbar({zoomWheelEnabled: false}),
>>          new OpenLayers.Control.PanZoomBar(),
>>          new OpenLayers.Control.ScaleLine()]
>>     });
>>
>>
>> So you can add the unit you want in this constructor.
>> according to the documentation :
>>
>> http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.units
>>
>> you can specify : ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’.
>>
>> Enjoy,
>>
>> Best regards.
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130129/ad5fc774/attachment.html>


More information about the Users mailing list