From dan.lamanna at kitware.com Fri Dec 9 15:27:16 2016 From: dan.lamanna at kitware.com (Dan LaManna) Date: Fri, 9 Dec 2016 15:27:16 -0500 Subject: [Geojs-users] Programatically creating annotations Message-ID: 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.manthey at kitware.com Fri Dec 9 15:38:37 2016 From: david.manthey at kitware.com (David Manthey) Date: Fri, 9 Dec 2016 15:38:37 -0500 Subject: [Geojs-users] Programatically creating annotations In-Reply-To: References: Message-ID: 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 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: From david.manthey at kitware.com Mon Dec 12 11:08:23 2016 From: david.manthey at kitware.com (David Manthey) Date: Mon, 12 Dec 2016 11:08:23 -0500 Subject: [Geojs-users] Programatically creating annotations In-Reply-To: References: Message-ID: 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 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 > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Mon Dec 12 14:17:01 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Mon, 12 Dec 2016 19:17:01 +0000 Subject: [Geojs-users] Programatically creating annotations In-Reply-To: References: Message-ID: 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 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 > 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 > 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: From david.manthey at kitware.com Mon Dec 12 14:24:30 2016 From: david.manthey at kitware.com (David Manthey) Date: Mon, 12 Dec 2016 14:24:30 -0500 Subject: [Geojs-users] Programatically creating annotations In-Reply-To: References: Message-ID: I?ve got a PR that adds an option to addAnnotation. Fundamentally, when you create a new annotation (via geo.annotation.pointAnnotation, 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 addAnnotation, 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). ? On Mon, Dec 12, 2016 at 2:17 PM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > 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 > 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 >> 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 >> 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 >> > -- David Manthey R&D Engineer Kitware Inc. (518) 881-4439 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Olsen.Erik at ensco.com Thu Dec 15 11:29:01 2016 From: Olsen.Erik at ensco.com (Olsen.Erik) Date: Thu, 15 Dec 2016 16:29:01 +0000 Subject: [Geojs-users] Question about LegendWidget Message-ID: <292e07cbef124f1ab918edea8e62ac94@ensco.com> All, I have been trying to set a custom color for my rectangles in a LegendWidget I am using. I was looking into the provided example code that said that the fillColor could be a string or object. Is there an example of how the fillColor object should be constructed? Here is some example code of what I'm trying to do: Note that the uilayer is a reference to a layer that I already made before instantiating the legendWidget. var legend = uilayer.createWidget('legend', { position : { bottom : 0, right: 0 } }); legend.categories([{ name : "Test", style: { fill : true, fillColor: {'r' : 1, 'b' : 1, 'g': 0} }, type : 'rect' }]); I was under the assumption that the color object would be an rgb object with values 0 to 1 as I have seen in other places in the geo.js code (specifically the geoJson reader) Any help would be appreciated. Thanks, Erik ________________________________ The information contained in this email message is intended only for the use of the individual(s) to whom it is addressed and may contain information that is privileged and sensitive. If you are not the intended recipient, or otherwise have received this communication in error, please notify the sender immediately by email at the above referenced address and note that any further dissemination, distribution or copying of this communication is strictly prohibited. The U.S. Export Control Laws regulate the export and re-export of technology originating in the United States. This includes the electronic transmission of information and software to foreign countries and to certain foreign nationals. Recipient agrees to abide by these laws and their regulations -- including the U.S. Department of Commerce Export Administration Regulations and the U.S. Department of State International Traffic in Arms Regulations -- and not to transfer, by electronic transmission or otherwise, any content derived from this email to either a foreign national or a foreign destination in violation of such laws. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.beezley at kitware.com Thu Dec 15 12:09:21 2016 From: jonathan.beezley at kitware.com (Jonathan Beezley) Date: Thu, 15 Dec 2016 12:09:21 -0500 Subject: [Geojs-users] Question about LegendWidget In-Reply-To: <292e07cbef124f1ab918edea8e62ac94@ensco.com> References: <292e07cbef124f1ab918edea8e62ac94@ensco.com> Message-ID: Hi Erik, The legend predates when we were attempting to normalize how colors are represented. It looks like it expects a valid CSS representation of color. You can use the method geo.util.convertColorToHex to convert anything accepted elsewhere in geojs to a hex string. Jon On Thu, Dec 15, 2016 at 11:29 AM, Olsen.Erik wrote: > All, > > > > I have been trying to set a custom color for my rectangles in a > LegendWidget I am using. I was looking into the provided example code that > said that the fillColor could be a string or object. Is there an example of > how the fillColor object should be constructed? > > > > Here is some example code of what I?m trying to do: > > Note that the uilayer is a reference to a layer that I already made before > instantiating the legendWidget. > > > > *var *legend = *uilayer*.createWidget(*'legend'*, { > position : { > bottom : 0, > right: 0 > } > }); > > > > > > legend.categories([{ > name : *"Test"*, > style: { > fill : *true*, > fillColor: {*'r' *: 1, *'b' *: 1, *'g'*: 0} > }, > type : > *'rect' *}]); > > > > > > I was under the assumption that the color object would be an rgb object > with values 0 to 1 as I have seen in other places in the geo.js code > (specifically the geoJson reader) > > > > Any help would be appreciated. > > > > Thanks, > > Erik > > > > > > ------------------------------ > > The information contained in this email message is intended only for the > use of the individual(s) to whom it is addressed and may contain > information that is privileged and sensitive. If you are not the intended > recipient, or otherwise have received this communication in error, please > notify the sender immediately by email at the above referenced address and > note that any further dissemination, distribution or copying of this > communication is strictly prohibited. > > The U.S. Export Control Laws regulate the export and re-export of > technology originating in the United States. This includes the electronic > transmission of information and software to foreign countries and to > certain foreign nationals. Recipient agrees to abide by these laws and > their regulations -- including the U.S. Department of Commerce Export > Administration Regulations and the U.S. Department of State International > Traffic in Arms Regulations -- and not to transfer, by electronic > transmission or otherwise, any content derived from this email to either a > foreign national or a foreign destination in violation of such laws. > > _______________________________________________ > 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: From Olsen.Erik at ensco.com Thu Dec 15 13:44:48 2016 From: Olsen.Erik at ensco.com (Olsen.Erik) Date: Thu, 15 Dec 2016 18:44:48 +0000 Subject: [Geojs-users] Question about LegendWidget In-Reply-To: References: <292e07cbef124f1ab918edea8e62ac94@ensco.com> Message-ID: <5c749b5aebf442a488b8c5cf59c219ad@ensco.com> Jon, Thanks for the quick response on this, that fixed my problem. Also, just wondering is there a way to add a title to the default legendWidget? Or would I need to extend it and write custom code in order to do that? Thanks, Erik From: Jonathan Beezley [mailto:jonathan.beezley at kitware.com] Sent: Thursday, December 15, 2016 12:09 PM To: Olsen.Erik Cc: geojs-users at public.kitware.com Subject: Re: [Geojs-users] Question about LegendWidget Hi Erik, The legend predates when we were attempting to normalize how colors are represented. It looks like it expects a valid CSS representation of color. You can use the method geo.util.convertColorToHex to convert anything accepted elsewhere in geojs to a hex string. Jon On Thu, Dec 15, 2016 at 11:29 AM, Olsen.Erik > wrote: All, I have been trying to set a custom color for my rectangles in a LegendWidget I am using. I was looking into the provided example code that said that the fillColor could be a string or object. Is there an example of how the fillColor object should be constructed? Here is some example code of what I?m trying to do: Note that the uilayer is a reference to a layer that I already made before instantiating the legendWidget. var legend = uilayer.createWidget('legend', { position : { bottom : 0, right: 0 } }); legend.categories([{ name : "Test", style: { fill : true, fillColor: {'r' : 1, 'b' : 1, 'g': 0} }, type : 'rect' }]); I was under the assumption that the color object would be an rgb object with values 0 to 1 as I have seen in other places in the geo.js code (specifically the geoJson reader) Any help would be appreciated. Thanks, Erik ________________________________ The information contained in this email message is intended only for the use of the individual(s) to whom it is addressed and may contain information that is privileged and sensitive. If you are not the intended recipient, or otherwise have received this communication in error, please notify the sender immediately by email at the above referenced address and note that any further dissemination, distribution or copying of this communication is strictly prohibited. The U.S. Export Control Laws regulate the export and re-export of technology originating in the United States. This includes the electronic transmission of information and software to foreign countries and to certain foreign nationals. Recipient agrees to abide by these laws and their regulations -- including the U.S. Department of Commerce Export Administration Regulations and the U.S. Department of State International Traffic in Arms Regulations -- and not to transfer, by electronic transmission or otherwise, any content derived from this email to either a foreign national or a foreign destination in violation of such laws. _______________________________________________ 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: From jonathan.beezley at kitware.com Thu Dec 15 13:53:01 2016 From: jonathan.beezley at kitware.com (Jonathan Beezley) Date: Thu, 15 Dec 2016 13:53:01 -0500 Subject: [Geojs-users] Question about LegendWidget In-Reply-To: <5c749b5aebf442a488b8c5cf59c219ad@ensco.com> References: <292e07cbef124f1ab918edea8e62ac94@ensco.com> <5c749b5aebf442a488b8c5cf59c219ad@ensco.com> Message-ID: You are correct, it isn't currently possible to add a title, but a PR to add that would be welcome :). On Thu, Dec 15, 2016 at 1:44 PM, Olsen.Erik wrote: > Jon, > > > > Thanks for the quick response on this, that fixed my problem. Also, just > wondering is there a way to add a title to the default legendWidget? Or > would I need to extend it and write custom code in order to do that? > > > > Thanks, > > Erik > > > > *From:* Jonathan Beezley [mailto:jonathan.beezley at kitware.com] > *Sent:* Thursday, December 15, 2016 12:09 PM > *To:* Olsen.Erik > *Cc:* geojs-users at public.kitware.com > *Subject:* Re: [Geojs-users] Question about LegendWidget > > > > Hi Erik, > > > > The legend predates when we were attempting to normalize how colors are > represented. It looks like it expects a valid CSS representation of > color. You can use the method geo.util.convertColorToHex > to > convert anything accepted elsewhere in geojs to a hex string. > > > > Jon > > > > On Thu, Dec 15, 2016 at 11:29 AM, Olsen.Erik wrote: > > All, > > > > I have been trying to set a custom color for my rectangles in a > LegendWidget I am using. I was looking into the provided example code that > said that the fillColor could be a string or object. Is there an example of > how the fillColor object should be constructed? > > > > Here is some example code of what I?m trying to do: > > Note that the uilayer is a reference to a layer that I already made before > instantiating the legendWidget. > > > > *var *legend = *uilayer*.createWidget(*'legend'*, { > position : { > bottom : 0, > right: 0 > } > }); > > > > > > legend.categories([{ > name : *"Test"*, > style: { > fill : *true*, > fillColor: {*'r' *: 1, *'b' *: 1, *'g'*: 0} > }, > type : > *'rect' *}]); > > > > > > I was under the assumption that the color object would be an rgb object > with values 0 to 1 as I have seen in other places in the geo.js code > (specifically the geoJson reader) > > > > Any help would be appreciated. > > > > Thanks, > > Erik > > > > > > > ------------------------------ > > > The information contained in this email message is intended only for the > use of the individual(s) to whom it is addressed and may contain > information that is privileged and sensitive. If you are not the intended > recipient, or otherwise have received this communication in error, please > notify the sender immediately by email at the above referenced address and > note that any further dissemination, distribution or copying of this > communication is strictly prohibited. > > The U.S. Export Control Laws regulate the export and re-export of > technology originating in the United States. This includes the electronic > transmission of information and software to foreign countries and to > certain foreign nationals. Recipient agrees to abide by these laws and > their regulations -- including the U.S. Department of Commerce Export > Administration Regulations and the U.S. Department of State International > Traffic in Arms Regulations -- and not to transfer, by electronic > transmission or otherwise, any content derived from this email to either a > foreign national or a foreign destination in violation of such laws. > > > _______________________________________________ > 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: