[OpenLayers-Dev] Abusing OpenLayers for a non-geo application: plausible?

Tim Schaub tschaub at opengeo.org
Tue Sep 28 12:40:01 EDT 2010


On 9/27/10 8:01 AM, Hendrik Fuß wrote:
> Hi folks,
>
> thanks everyone for the comments. So far I have experimented with a
> Zoomify layer and a few editing controls and got really promising
> results. I'm all excited. OpenLayers rocks!
>
> OL/Zoomify seems to handle pixel coordinates well. I'm still
> struggling to teach it micrometers instead of pixels... will need to
> have a closer look at the docs I suppose. I will definitely look into
> tile servers such as iipimage and djatoka, as well as into gdal2tiles.
>
> I think most of the work on my side will be about serving and storing
> vector content on the server side. GML is probably okay for me, even
> if I feel a bit strange about using a "geographic markup language" for
> my non-geographical application. I will also need to write some custom
> event handlers for drawing on the client side: I need a freehand style
> drawing tool, as well as ellipse and circle tools.
>

If we mean the same thing by "freehand," see this example:

http://openlayers.org/dev/examples/draw-feature.html

As mentioned in that page, holding down the shift key will trigger 
freehand drawing (one vertex per mousemove).  If you want freehand by 
default, set up the control with handlerOptions.  E.g.

     var scribble = new OpenLayers.Control.DrawFeature(
         layer,
         OpenLayers.Handler.Path,
         {handlerOptions: {freehand: true}}
     );
     // awkward, yes

And, depending on your needs, you may be able to get ellipse drawing 
with by using the RegularPolygon handler for the DrawFeature control 
with the irregular option true.

     var ellipse = new OpenLayers.Control.DrawFeature(
         layer,
         OpenLayers.Handler.RegularPolygon,
         {handlerOptions: {irregular: true, sides: 40}}
     );

http://openlayers.org/dev/examples/regular-polygons.html

> Is there any piece of developer documentation that you would recommend
> apart from the APIs, such as books?

My opinion is that our examples are currently the best source of 
"documentation."  Though it takes a fair bit of knowledge to get 
started, with the examples and the library source, you can usually piece 
together what you need.

People have talked about books, but I don't think the terms have been 
right (yet).

Tim

>
> Again, thanks for your input. If I proceed with the project, I'm
> hoping to finally contribute code back to OpenLayers as far as
> possible.
>

PS - If you are interested in contributing documentation, that's 
probably where we could use the most help :).


> bye
> Hendrik
>
>
>
> 2010/9/27 Adrià Mercader<amercader.dev at gmail.com>:
>> Hi Hendrick,
>>
>> Sean's answer covers all the main aspects you may face using OL with
>> non-geo images. I would only add that gdal2tiles [1] makes extremely
>> easy to build tiled pyramids for large images and their corresponding
>> OpenLayers based viewers, like this one:
>>
>> http://amercader.net/books.html
>>
>> You may give it a look a see if it can help you.
>>
>> Cheers,
>>
>> Adrià
>>
>>
>> [1] http://www.klokan.cz/projects/gdal2tiles/
>>
>>
>>
>> Sean a
>>
>> On 24 September 2010 10:31, Hendrik Fuß<hendrik.fuss at gmail.com>  wrote:
>>> Hi folks,
>>>
>>> I'm sorry if you receive this as a duplicate post -- I've had some
>>> problems subscribing to the list, so I'm not sure whether my initial
>>> post got through or not.
>>>
>>> I'd be interested in your opinions on the following: I am planning to
>>> develop a web application that is not exactly about geographical data,
>>> but on a technical level has a lot in common with OpenLayers, so I'm
>>> wondering whether I could 'abuse' OpenLayers for the task.
>>>
>>> The application is essentially about sharing and markup of large,
>>> microscopic images. It allow users to upload such images for others to
>>> view. Viewers should be able to zoom and pan through the image, mark
>>> objects and create vector drawings on top of the image, then save
>>> everything for others to view or download the vector data to
>>> specialized microscopic software.
>>>
>>> With all the UI control, support for tiled images and markup,
>>> OpenLayers looks very tempting to me, but I haven't had any exposure
>>> to the development side. So I was wondering what you think, does this
>>> sound feasible? What problems would you anticipate?
>>>
>>> many thanks
>>> Hendrik
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>>>
>>
>>
>>
>> --
>>
>>
>> Adrià Mercader
>> -----------------------------
>> http://amercader.net
>>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev


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


More information about the Dev mailing list