<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important">If <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">layer</code> is an annotationLayer, then you can create a point like so:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">layer.addAnnotation(geo.annotation.pointAnnotation({position: {x: -118, y: 37}}))
</code></pre><p style="margin:1.2em 0px!important">Each annotation takes separate options. They all take an optional style specification. Points get a single <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">position</code>. Polygons take a list of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">vertices</code> (alternately called <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">coordinates</code>). Rectangles take a list of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">corners</code> (alternately called <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">coordinates</code>).</p>
<div title="MDH:SWYgYGxheWVyYCBpcyBhbiBhbm5vdGF0aW9uTGF5ZXIsIHRoZW4geW91IGNhbiBjcmVhdGUgYSBw
b2ludCBsaWtlIHNvOjxkaXY+PGJyPjwvZGl2PjxkaXY+YGBgPC9kaXY+PGRpdj5sYXllci5hZGRB
bm5vdGF0aW9uKGdlby5hbm5vdGF0aW9uLnBvaW50QW5ub3RhdGlvbih7cG9zaXRpb246IHt4OiAt
MTE4LCB5OiAzN319KSk8YnI+PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2
PkVhY2ggYW5ub3RhdGlvbiB0YWtlcyBzZXBhcmF0ZSBvcHRpb25zLiAmbmJzcDtUaGV5IGFsbCB0
YWtlIGFuIG9wdGlvbmFsIHN0eWxlIHNwZWNpZmljYXRpb24uICZuYnNwO1BvaW50cyBnZXQgYSBz
aW5nbGUgYHBvc2l0aW9uYC4gJm5ic3A7UG9seWdvbnMgdGFrZSBhIGxpc3Qgb2YgYHZlcnRpY2Vz
YCAoYWx0ZXJuYXRlbHkgY2FsbGVkIGBjb29yZGluYXRlc2ApLiAmbmJzcDtSZWN0YW5nbGVzIHRh
a2UgYSBsaXN0IG9mIGBjb3JuZXJzYCAoYWx0ZXJuYXRlbHkgY2FsbGVkIGBjb29yZGluYXRlc2Ap
LjwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 9, 2016 at 3:27 PM, Dan LaManna <span dir="ltr"><<a href="mailto:dan.lamanna@kitware.com" target="_blank">dan.lamanna@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all - <div><br></div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>Thanks GeoJSers!<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_-8514659798669720777gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Dan LaManna<br></div><div><span style="font-size:12.8px">Kitware, Inc.</span></div></div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Geojs-users mailing list<br>
<a href="mailto:Geojs-users@public.kitware.com">Geojs-users@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/geojs-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/geojs-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">David Manthey</div><div dir="ltr">R&D Engineer<br>Kitware Inc.<br>(518) 881-4439<br></div></div></div></div>
</div>