<div dir="ltr"><span style="color:rgb(33,33,33)">We probably should modify this for creation</span><br><div><span style="color:rgb(33,33,33)">+1 if you meant providing an option in the API. <br></span></div><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">- Aashish</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 12, 2016 at 11:08 AM David Manthey <<a href="mailto:david.manthey@kitware.com">david.manthey@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="m_1570673809408359757markdown-here-wrapper gmail_msg"><p style="margin:1.2em 0px!important" class="gmail_msg">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:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><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-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="gmail_msg">layer.addAnnotation(geo.annotation.pointAnnotation({position: geo.transform.transformCoordinates(map.ingcs(), map.gcs(), {x: -125, y: 37.3})}))
</code></pre><div title="MDH:VGhlIGFubm90YXRpb24gaW50ZXJuYWxseSBzdG9yZXMgY29vcmRpbmF0ZXMgaW4gdGhlIG1hcCBn
Y3MgKG5vdCB0aGUgaW50ZXJmYWNlIGdjcykuIMKgV2UgcHJvYmFibHkgc2hvdWxkIG1vZGlmeSB0
aGlzIGZvciBjcmVhdGlvbiwgc2luY2UgbXkgZXhhbXBsZSBzaG91bGQgaGF2ZSBiZWVuOjxkaXY+
PGJyPjwvZGl2PjxkaXY+YGBgPC9kaXY+PGRpdj5sYXllci5hZGRBbm5vdGF0aW9uKGdlby5hbm5v
dGF0aW9uLnBvaW50QW5ub3RhdGlvbih7cG9zaXRpb246IGdlby50cmFuc2Zvcm0udHJhbnNmb3Jt
Q29vcmRpbmF0ZXMobWFwLmluZ2NzKCksIG1hcC5nY3MoKSwge3g6IC0xMjUsIHk6IDM3LjN9KX0p
KTxicj48L2Rpdj48ZGl2PmBgYDwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class="gmail_msg">​</div></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Dec 9, 2016 at 3:38 PM, David Manthey <span dir="ltr" class="gmail_msg"><<a href="mailto:david.manthey@kitware.com" class="gmail_msg" target="_blank">david.manthey@kitware.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="m_1570673809408359757m_-7608974815090182344markdown-here-wrapper gmail_msg"><p style="margin:1.2em 0px!important" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg"><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-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="gmail_msg">layer.addAnnotation(geo.annotation.pointAnnotation({position: {x: -118, y: 37}}))
</code></pre><p style="margin:1.2em 0px!important" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg">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" class="gmail_msg">​</div></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><div class="m_1570673809408359757h5 gmail_msg">On Fri, Dec 9, 2016 at 3:27 PM, Dan LaManna <span dir="ltr" class="gmail_msg"><<a href="mailto:dan.lamanna@kitware.com" class="gmail_msg" target="_blank">dan.lamanna@kitware.com</a>></span> wrote:<br class="gmail_msg"></div></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="m_1570673809408359757h5 gmail_msg"><div dir="ltr" class="gmail_msg">Hi all - <div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks GeoJSers!<span class="m_1570673809408359757m_-7608974815090182344HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_1570673809408359757m_-7608974815090182344m_-8514659798669720777gmail_signature gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg">Dan LaManna<br class="gmail_msg"></div><div class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg">Kitware, Inc.</span></div></div></div></div>
</font></span></div></div>
<br class="gmail_msg"></div></div>_______________________________________________<br class="gmail_msg">
Geojs-users mailing list<br class="gmail_msg">
<a href="mailto:Geojs-users@public.kitware.com" class="gmail_msg" target="_blank">Geojs-users@public.kitware.com</a><br class="gmail_msg">
<a href="http://public.kitware.com/mailman/listinfo/geojs-users" rel="noreferrer" class="gmail_msg" target="_blank">http://public.kitware.com/mailman/listinfo/geojs-users</a><br class="gmail_msg">
<br class="gmail_msg"></blockquote></div><span class="m_1570673809408359757HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_1570673809408359757m_-7608974815090182344gmail_signature gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg">David Manthey</div><div dir="ltr" class="gmail_msg">R&D Engineer<br class="gmail_msg">Kitware Inc.<br class="gmail_msg"><a href="tel:%28518%29%20881-4439" value="+15188814439" class="gmail_msg" target="_blank">(518) 881-4439</a><br class="gmail_msg"></div></div></div></div>
</font></span></div>
</blockquote></div><br class="gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_1570673809408359757gmail_signature gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg">David Manthey</div><div dir="ltr" class="gmail_msg">R&D Engineer<br class="gmail_msg">Kitware Inc.<br class="gmail_msg"><a href="tel:(518)%20881-4439" value="+15188814439" class="gmail_msg" target="_blank">(518) 881-4439</a><br class="gmail_msg"></div></div></div></div>
</div>
_______________________________________________<br class="gmail_msg">
Geojs-users mailing list<br class="gmail_msg">
<a href="mailto:Geojs-users@public.kitware.com" class="gmail_msg" target="_blank">Geojs-users@public.kitware.com</a><br class="gmail_msg">
<a href="http://public.kitware.com/mailman/listinfo/geojs-users" rel="noreferrer" class="gmail_msg" target="_blank">http://public.kitware.com/mailman/listinfo/geojs-users</a><br class="gmail_msg">
</blockquote></div>