<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important">I’ve got a PR that adds an option to <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">addAnnotation</code>.</p>
<p style="margin:1.2em 0px!important">Fundamentally, when you create a new annotation (via <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">geo.annotation.pointAnnotation</code>, for instance), that annotation isn’t attached to a map yet, so has no concept of which gcs should be used.  Once attached to an annotation layer, it does.  By adding an option to <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">addAnnotation</code>, this becomes something that can be controlled.  In the PR, it now defaults to using the map’s interface gcs if you don’t specify otherwise (not the display gcs).</p>
<div title="MDH:SSd2ZSBnb3QgYSBQUiB0aGF0IGFkZHMgYW4gb3B0aW9uIHRvIGBhZGRBbm5vdGF0aW9uYC48ZGl2
Pjxicj48L2Rpdj48ZGl2PkZ1bmRhbWVudGFsbHksIHdoZW4geW91IGNyZWF0ZSBhIG5ldyBhbm5v
dGF0aW9uICh2aWEgYGdlby5hbm5vdGF0aW9uLnBvaW50QW5ub3RhdGlvbmAsIGZvciBpbnN0YW5j
ZSksIHRoYXQgYW5ub3RhdGlvbiBpc24ndCBhdHRhY2hlZCB0byBhIG1hcCB5ZXQsIHNvIGhhcyBu
byBjb25jZXB0IG9mIHdoaWNoIGdjcyBzaG91bGQgYmUgdXNlZC4gJm5ic3A7T25jZSBhdHRhY2hl
ZCB0byBhbiBhbm5vdGF0aW9uIGxheWVyLCBpdCBkb2VzLiAmbmJzcDtCeSBhZGRpbmcgYW4gb3B0
aW9uIHRvIGBhZGRBbm5vdGF0aW9uYCwgdGhpcyBiZWNvbWVzIHNvbWV0aGluZyB0aGF0IGNhbiBi
ZSBjb250cm9sbGVkLiAmbmJzcDtJbiB0aGUgUFIsIGl0IG5vdyBkZWZhdWx0cyB0byB1c2luZyB0
aGUgbWFwJ3MgaW50ZXJmYWNlIGdjcyBpZiB5b3UgZG9uJ3Qgc3BlY2lmeSBvdGhlcndpc2UgKG5v
dCB0aGUgZGlzcGxheSBnY3MpLjwvZGl2Pg==" 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 Mon, Dec 12, 2016 at 2:17 PM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@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"><span class=""><span style="color:rgb(33,33,33)">We probably should modify this for creation</span><br></span><div><span style="color:rgb(33,33,33)">+1 if you meant providing an option in the API. <span class="HOEnZb"><font color="#888888"><br></font></span></span></div><span class="HOEnZb"><font color="#888888"><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">- Aashish</span></div></font></span></div><div class="HOEnZb"><div class="h5"><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" target="_blank">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="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757markdown-here-wrapper m_365587104293379243gmail_msg"><p style="margin:1.2em 0px!important" class="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_msg">layer.addAnnotation(geo.<wbr>annotation.pointAnnotation({<wbr>position: geo.transform.<wbr>transformCoordinates(map.<wbr>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="m_365587104293379243gmail_msg">​</div></div></div><div class="gmail_extra m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"><div class="gmail_quote m_365587104293379243gmail_msg">On Fri, Dec 9, 2016 at 3:38 PM, David Manthey <span dir="ltr" class="m_365587104293379243gmail_msg"><<a href="mailto:david.manthey@kitware.com" class="m_365587104293379243gmail_msg" target="_blank">david.manthey@kitware.com</a>></span> wrote:<br class="m_365587104293379243gmail_msg"><blockquote class="gmail_quote m_365587104293379243gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757m_-7608974815090182344markdown-here-wrapper m_365587104293379243gmail_msg"><p style="margin:1.2em 0px!important" class="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_msg">layer.addAnnotation(geo.<wbr>annotation.pointAnnotation({<wbr>position: {x: -118, y: 37}}))
</code></pre><p style="margin:1.2em 0px!important" class="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_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="m_365587104293379243gmail_msg">​</div></div></div><div class="gmail_extra m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"><div class="gmail_quote m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757h5 m_365587104293379243gmail_msg">On Fri, Dec 9, 2016 at 3:27 PM, Dan LaManna <span dir="ltr" class="m_365587104293379243gmail_msg"><<a href="mailto:dan.lamanna@kitware.com" class="m_365587104293379243gmail_msg" target="_blank">dan.lamanna@kitware.com</a>></span> wrote:<br class="m_365587104293379243gmail_msg"></div></div><blockquote class="gmail_quote m_365587104293379243gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757h5 m_365587104293379243gmail_msg"><div dir="ltr" class="m_365587104293379243gmail_msg">Hi all - <div class="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div><div class="m_365587104293379243gmail_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="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div><div class="m_365587104293379243gmail_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="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div><div class="m_365587104293379243gmail_msg">Thanks GeoJSers!<span class="m_365587104293379243m_1570673809408359757m_-7608974815090182344HOEnZb m_365587104293379243gmail_msg"><font color="#888888" class="m_365587104293379243gmail_msg"><br clear="all" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div>-- <br class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757m_-7608974815090182344m_-8514659798669720777gmail_signature m_365587104293379243gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><div dir="ltr" class="m_365587104293379243gmail_msg">Dan LaManna<br class="m_365587104293379243gmail_msg"></div><div class="m_365587104293379243gmail_msg"><span style="font-size:12.8px" class="m_365587104293379243gmail_msg">Kitware, Inc.</span></div></div></div></div>
</font></span></div></div>
<br class="m_365587104293379243gmail_msg"></div></div>______________________________<wbr>_________________<br class="m_365587104293379243gmail_msg">
Geojs-users mailing list<br class="m_365587104293379243gmail_msg">
<a href="mailto:Geojs-users@public.kitware.com" class="m_365587104293379243gmail_msg" target="_blank">Geojs-users@public.kitware.com</a><br class="m_365587104293379243gmail_msg">
<a href="http://public.kitware.com/mailman/listinfo/geojs-users" rel="noreferrer" class="m_365587104293379243gmail_msg" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/geojs-users</a><br class="m_365587104293379243gmail_msg">
<br class="m_365587104293379243gmail_msg"></blockquote></div><span class="m_365587104293379243m_1570673809408359757HOEnZb m_365587104293379243gmail_msg"><font color="#888888" class="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"><br clear="all" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div>-- <br class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757m_-7608974815090182344gmail_signature m_365587104293379243gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><div dir="ltr" class="m_365587104293379243gmail_msg">David Manthey</div><div dir="ltr" class="m_365587104293379243gmail_msg">R&D Engineer<br class="m_365587104293379243gmail_msg">Kitware Inc.<br class="m_365587104293379243gmail_msg"><a href="tel:%28518%29%20881-4439" value="+15188814439" class="m_365587104293379243gmail_msg" target="_blank">(518) 881-4439</a><br class="m_365587104293379243gmail_msg"></div></div></div></div>
</font></span></div>
</blockquote></div><br class="m_365587104293379243gmail_msg"><br clear="all" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><br class="m_365587104293379243gmail_msg"></div>-- <br class="m_365587104293379243gmail_msg"><div class="m_365587104293379243m_1570673809408359757gmail_signature m_365587104293379243gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="m_365587104293379243gmail_msg"><div class="m_365587104293379243gmail_msg"><div dir="ltr" class="m_365587104293379243gmail_msg">David Manthey</div><div dir="ltr" class="m_365587104293379243gmail_msg">R&D Engineer<br class="m_365587104293379243gmail_msg">Kitware Inc.<br class="m_365587104293379243gmail_msg"><a href="tel:(518)%20881-4439" value="+15188814439" class="m_365587104293379243gmail_msg" target="_blank">(518) 881-4439</a><br class="m_365587104293379243gmail_msg"></div></div></div></div>
</div>
______________________________<wbr>_________________<br class="m_365587104293379243gmail_msg">
Geojs-users mailing list<br class="m_365587104293379243gmail_msg">
<a href="mailto:Geojs-users@public.kitware.com" class="m_365587104293379243gmail_msg" target="_blank">Geojs-users@public.kitware.com</a><br class="m_365587104293379243gmail_msg">
<a href="http://public.kitware.com/mailman/listinfo/geojs-users" rel="noreferrer" class="m_365587104293379243gmail_msg" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/geojs-users</a><br class="m_365587104293379243gmail_msg">
</blockquote></div>
</div></div></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>