[OpenLayers-Dev] Draw boxes on the image pressing shift key

Tim Schaub tschaub at opengeo.org
Wed Aug 4 21:37:48 EDT 2010


On 8/4/10 4:56 PM, Andreas Hocevar wrote:
> Hi,
>
> you could use OpenLayers.Control.TransformFeature for
> moving/reshaping your boxes. See
> http://openlayers.org/dev/examples/transform-feature.html for an
> example.
>

That example is so damn sexy!

> Regards, Andreas.
>
> On Aug 5, 2010, at 00:25 , Moiz Bhukhiya wrote:
>
>> I see now what you're saying. I clicked on the checkbox and now the
>> boxes are inline of horizontal line. But is there a way to modify
>> the box drawn?/
>>
>> Thanks. Moiz
>>
>> On Wed, Aug 4, 2010 at 5:22 PM, Moiz
>> Bhukhiya<moiz.bhukhiya at gmail.com>  wrote: Thanks alot Tim for your
>> response.
>>
>> It seems like it will be helpful for resizing the square box, but
>> how to move this square and the square box seems to be in 45 degree
>> angle to the horizontal line. I need square to be drawn inline with
>> horizontal line. It should be resizable by dragging it edges like
>> we see in the Jquery plugin I mentioned.
>> http://odyniec.net/projects/imgareaselect
>>
>>
>> Thanks again for your help. I really appreciate it. Moiz
>>
>>
>> On Wed, Aug 4, 2010 at 2:49 PM, Tim Schaub<tschaub at opengeo.org>
>> wrote: On 8/4/10 12:31 PM, Moiz Bhukhiya wrote:
>>> Hello Devs,
>>>
>>> I am using Openlayers to display images from Djatoka Image
>>> server. I am using two different layers. 1. To draw boxes on an
>>> image which is OpenLayers.Layer.Boxes 2. To dynamically draw
>>> boxes on images I am using OpenLayers.Control()
>>>
>>> Using Control() functionality I can draw boxes on the image
>>> pressing shift key and on mouse down, and on mouse up I can get
>>> the coordinates of the box on the image. On mouse up the box
>>> disappears and I get the coordinates. My problem is I do not want
>>> this box to disappear until I invoke it. I want to draw the box
>>> and resize it if required (like we do in Jquery crop plugin
>>> Eg:http://odyniec.net/projects/imgareaselect )
>>>
>>> It would be of great help if you could guide me how do I achieve
>>> this functionality.
>>>
>>
>> Alternatively, you could use a Vector layer and a DrawFeature
>> control with a RegularPolygon handler.
>>
>> See http://openlayers.org/dev/examples/regular-polygons.html
>>
>> Sounds like an irregular polygon with four sides (rectangle)
>> snapped to 90 would give you want you want.
>>
>> Tim
>>
>>> Thanks, Moiz
>>>
>>>
>>>
>>> _______________________________________________ Dev mailing list
>>> Dev at openlayers.org http://openlayers.org/mailman/listinfo/dev
>>
>>
>> -- Tim Schaub OpenGeo - http://opengeo.org Expert service straight
>> from the developers.
>> _______________________________________________ Dev mailing list
>> Dev at openlayers.org http://openlayers.org/mailman/listinfo/dev
>>
>>
>> _______________________________________________ Dev mailing list
>> Dev at openlayers.org http://openlayers.org/mailman/listinfo/dev
>
>
>


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list