How to clear an ILayer? - arcobjects

I can clear all the layers using mapControl.ClearLayers(), but I only want to clear one layer (a sublayer of a basemap, like cities). I'm new at this, thanks in advance.
edit: i am using C#

I'm unsure of which API you are using, but I know C# well. When you add layers you usually attach a name to the property. You can either choose it by the name, or the index.
mapControl.Layers[1].Clear();
mapControl.Layers["My Layer"].Clear();

Related

Changing the default order of products on category view

I want to change the default category sorting from whatever it is by default to NEWSEST FIRST. Seems like there is no way to set this in the backend, so how can I achieve this?
Well, I think there are two ways.
Create your own sort option in a module using a plugin. Something like this: https://magento.stackexchange.com/questions/96095/magento-2-how-to-add-custom-sort-by-option. Look at Luca S's answer. I think this person has a general idea of how to do it.
Use Position option but modified:
http://magento2x.com/magento-sort-newest-products-solution/.
I dont like how they both override stuff, but hopefully this will give you a starting point. Good Luck.

remove polygon / polyline from a bing map

With the Bing v7 AJAX control, if it contains several polygons/polylines, and I want to remove all of them at once, how do I go about doing this? I suppose I can loop through the map.Entities collection and inspect each to see if it is a poly* object, but I was wondering if there is an easier way?
When there's a need to handle a group of elements easily I usually place them on an EntityCollection. Then, you can just hide/remove that layer.
Check out this example. It hides the entities instead of removing them, but the principle is the same.

Drupal - dynamic options for text_list field

I have a custom node type for which I want to have a field that uses a special combobox based on list_text. When one chooses the type list_text it is normally possible to enter a static list of selectable texts, however, I want this list to be dynamic, i.e. based on the results of a db_query. What is the best way to do this using Drupal 7?
A simple example for clarification: A node of this custom type X contains a field that points to another node, so whenever a node of type X is created I want a combobox that contains all other nodes.
(Best solution would be to only display the combobox during node creation, and no longer during edit. But I could also live with it if the combobox was shown during the edit as well.)
I have tried to customize options_select by defining my own data type and implementing hook_options_list accordingly. The combobox was displayed during creation with the correct values, however, I could not save it.. I have no idea what went wrong there, but on the first submit it would change to a different theme, and when I tried again I got an internal server error. Am I on the right track at all with defining a completely new data type for the field? there surely must be a simpler way?
You're right in that you don't need a new datatype. Here's a good tutorial on how to do this. It's not specifically for D7 but I didn't see much that wasn't still applicable. There may be a better way to do it in D7 specifically but I would love to know it too if so :)
The tutorial linked by allegroconmolto sent me on the right way. Thanks for that.
Here's the simpler way of doing it: tutorial
Basically, it is, as I assumed, a common problem and hence a simple solution for it was included in the webform module by now. It provides a hook_webform_select_options_info which can be used to register a callback method. The callback method is then called each time a corresponding option select of a webform is shown, so that you can easily fill it with the results of a dbquery or anything else. Works like a charm and takes next to no time to implement.

Filter/Sort the classes in problems view based on author in eclipse

I need to filter or sort the warnings in problems,Tasks view based on the author names given in the class.[#author userName]. Is there any way i could configure it. If not can some one give direction to extend the view and add my own either filter or sorting.
Thanks in advance
There doesnt seem to be a way to do this by default, but extending the problems view to add this information seems feasible. See this for example: http://www.pushing-pixels.org/?p=881

ASTNodes And Views

I would like to know if there is a function that when i give it an ASTNode object (the ASTNode can be a class, method or a field in a CompilationUnit) as an argument it can show this object in a view (Tree view or Table view). If there isn't any such function, is there another way or workaround of doing it?
Thanks for your help.
You may be able to use the ASTView plugin
It's not clear if you are referring to Java or just something else. I'm assuming you need a Java tool. I'm not sure what exactly you expect to see in the "view".
Do check out nWire. It may be what you are looking for. Given any component in your code (like Class, field, etc.) it can show all possible associations to other components.