[Geojs-users] Programatically creating annotations

David Manthey david.manthey at kitware.com
Fri Dec 9 15:38:37 EST 2016

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/geojs-users/attachments/20161209/752b370a/attachment.html>

More information about the Geojs-users mailing list