[Geojs-users] Programatically creating annotations

Aashish Chaudhary aashish.chaudhary at kitware.com
Mon Dec 12 14:17:01 EST 2016


We probably should modify this for creation
+1 if you meant providing an option in the API.

- Aashish

On Mon, Dec 12, 2016 at 11:08 AM David Manthey <david.manthey at kitware.com>
wrote:

> The annotation internally stores coordinates in the map gcs (not the
> interface gcs). We probably should modify this for creation, since my
> example should have been:
>
> layer.addAnnotation(geo.annotation.pointAnnotation({position: geo.transform.transformCoordinates(map.ingcs(), map.gcs(), {x: -125, y: 37.3})}))
>
>>
> On Fri, Dec 9, 2016 at 3:38 PM, David Manthey <david.manthey at kitware.com>
> wrote:
>
> If layer is an annotationLayer, then you can create a point like so:
>
> layer.addAnnotation(geo.annotation.pointAnnotation({position: {x: -118, y: 37}}))
>
> Each annotation takes separate options. They all take an optional style
> specification. Points get a single position. Polygons take a list of
> vertices (alternately called coordinates). Rectangles take a list of
> corners (alternately called coordinates).
>>
> On Fri, Dec 9, 2016 at 3:27 PM, Dan LaManna <dan.lamanna at kitware.com>
> wrote:
>
> Hi all -
>
> For background, in geonotebook we're "replaying" server side state to the
> client (in the event of a refresh, for example). We have our own
> definitions of annotations (in Python) which contain the necessary data
> (coordinates, style information, etc) to create annotations within GeoJS.
>
> After taking a brief look at the GeoJS annotation code, it seems closely
> tied to the user interaction aspect of creating annotations. What we're
> looking for is a simple way to create an annotation (point, rectangle,
> polygon) from Javascript without any user interaction. Is there a
> straightforward API for this that I'm missing?
>
> Thanks GeoJSers!
>
> --
> Dan LaManna
> Kitware, Inc.
>
> _______________________________________________
> Geojs-users mailing list
> Geojs-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/geojs-users
>
>
>
>
> --
> David Manthey
> R&D Engineer
> Kitware Inc.
> (518) 881-4439
>
>
>
>
> --
> David Manthey
> R&D Engineer
> Kitware Inc.
> (518) 881-4439
> _______________________________________________
> Geojs-users mailing list
> Geojs-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/geojs-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/geojs-users/attachments/20161212/32d3ffe5/attachment.html>


More information about the Geojs-users mailing list