Skip to first unread message

Jacob Fullerton

unread,
Jun 16, 2016, 5:39:00 PM6/16/16
to Tethys Platform
I have a layer that I generate in javascript as part of a browser geoprocessing request. The layer imports just fine into the map, but I don't know how to access the legend to add the layer directly with an appropriate title. At this point when the layer generates, the legend doesn't update at all. However, when I draw a new feature (either a point or a polygon) the legend updates to include my new layer and calls it 'Untitled"
6.16.16_Update Legend_1.PNG
6.16.16_Update Legend_2.PNG

Jacob Fullerton

unread,
Jun 20, 2016, 5:59:41 PM6/20/16
to Tethys Platform
So I found out that if I make the update_legend() function public by including it in the public_interface { } list I am able to call the function and update the legend each time I update the layer. Is there a way that I could call the function in it's original state from my main.js file? In other words, the functions that I need are heavily integrated into the TETHYS_MAP_VIEW function that defines the map object, and if I could call just the update_legend() function I don't have to try to extricate the function with its various pieces and variables, which would be cumbersome to say the least.
6.20.16_Update the Legend_1.PNG
6.20.16_Update the Legend_2.PNG
6.20.16_Update the Legend_3.PNG

Jacob Fullerton

unread,
Jun 20, 2016, 7:02:43 PM6/20/16
to Tethys Platform
Hey everyone,

My question is whether or not I can access a function called update_legend() inside of the TETHYS_MAP_VIEW() function in the tethys platform. Copying the needed function is extremely cumbersome as update_legend() has a lot of dependencies.

If it is not possible to directly call the function from my main.js script, is it possible that an additional line of code can be added to the tethys_map_view.js file? By making update_legend() public I am able to access the needed code and everything works without flaw. I have done this in my instance of Tethys. I've attached the following for reference.


​This is adding the update_legend() function to the public interface, making the function public at the same time. The file in question is the following: < /usr/lib/tethys/src/tethys_gizmos/static/tethys_gizmos/js/tethys_map_view.js >


​This is the map updating the legend just before displaying the new layer being created by the user. The function used at the break is: TETHYS_MAP_VIEW.updateLegend();. It serves my need perfectly.

swainn

unread,
Jun 21, 2016, 11:32:45 AM6/21/16
to Tethys Platform
Jacob,

This sounds like a good idea to me, but amounts to a new feature in Tethys. We have a formalized way of requesting new features to Tethys: http://www.tethysplatform.org/project-steering-committee

Let's open this up for an official vote.

+1

Assuming it is approved, Jacob, you will need to create a Fork of Tethys Platform, make the changes you have suggested, and issue a Pull Request. Then we'll integrate it into the development branch of Tethys and it will be released with the next version of Tethys.

Michael S

unread,
Jun 21, 2016, 5:01:16 PM6/21/16
to Tethys Platform
+1

Dan Ames

unread,
Jun 21, 2016, 10:47:31 PM6/21/16
to Michael S, Tethys Platform
+1

--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/f298ef59-69f7-41eb-bfc4-6d22928481a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alansnow21

unread,
Jun 22, 2016, 3:15:55 PM6/22/16
to Tethys Platform
+1

Shawn Crawley

unread,
Jun 22, 2016, 3:23:56 PM6/22/16
to alansnow21, Tethys Platform

+1


On Wed, Jun 22, 2016, 1:15 PM alansnow21 <alans...@gmail.com> wrote:
+1

--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.

sdc50

unread,
Jun 24, 2016, 11:16:42 AM6/24/16
to Tethys Platform
+1

swainn

unread,
Jun 29, 2016, 10:50:55 PM6/29/16
to Tethys Platform
I added an update legend method to public interface of Tethys Map View. Available on dev branch now,  This will be officially released in version 1.4.0.

Jacob Fullerton

unread,
Jun 30, 2016, 2:26:29 PM6/30/16
to Tethys Platform
Thanks, I appreciate it! You mentioned before that you needed me to send my update via github, is that still something that you need? Seems like you already typed things in

swainn

unread,
Jun 30, 2016, 5:54:27 PM6/30/16
to Tethys Platform
This was pretty easy to do, so I threw it in quickly, so you don't need to do anything. :D

However, you've made several other good feature suggestions. For those, we'll probably ask you to implement them using the "fork-pull" workflow (see: https://github.com/tethysplatform/tethys/wiki/Contributing).
Reply all
Reply to author
Forward
0 new messages