-
Notifications
You must be signed in to change notification settings - Fork 72
Conversation
Discussions went on in our mailing list: I think we should continue this here. |
I've just added new commits. We are now using the approach found by Eric on jsfiddle. I think it's very similar to what Marc did to start with, but it looks a little more clean. Also, the directive is now using a standard partial (templateUrl parameter) for all purposes. We are using ng-if statements to make sure the right stuff is created. Examples as well as integration in accordion is done. There's a couple of things still to be done (I'll work on that next week. Today no more time):
Please review current code. I'm especially worried about 1 and 2. |
I analysed a little further. Scopes are all destroyed via $destroy call on the parent element. Anyhow, memory consumption still grows contiually maybe because the GC didn't kick in yet. Any way to force that to happen? |
I did some rough analysis on memory consumption:
[1] angular/batarang#62 |
@@ -184,6 +185,8 @@ | |||
} | |||
} | |||
.accordion-inner { | |||
max-height: 480px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be depending on screen-size (and orientation?). We'll let @tonio deal with this.
I thinks it would make sense to merge this into master, even though it's not fully complete. Please review. |
Just a detail, but there’s a mix between (2|4) spaces in your less files (app.less & catalogtree.less). |
@tonio Good find. Should be fixed now. |
.ga-catalogtree-entry { | ||
margin-top: 0px; | ||
margin-bottom: 0px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ga-catalogtree-entry rule is defined twice.
Since you're using the service CatalogServer you could remove the file src/components/catalogtree/example/tree.json |
I think it makes sense to not have a dependency to some external service in examples. |
ok I get it On Thu, Aug 8, 2013 at 2:33 PM, Gilbert Jeiziner
|
map.removeLayer(layer); | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid code duplication (search and catalog, probably layertree later), functions like removeLayerFromMap, addLayerToMap, getMapLayer could all in a service like gaMapUtils. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely. This is on Eric's desk as part of the layer list component.
Other existing directives will need to be changed once this components will
be ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or the gaLayers could provide convenience functions to add and remove layers to maps.
gaLayers.addToMap(layerId, map);
gaLayers.removeFromMap(layerId, map);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be added to gaLayers. Right now, this service is map agnostic.
Also, I think this new component will need to take care of other things as well. We have different kinds of layers: background, cataloglayers* (wms, wmts, aggregate), kml import layers_, wms import layers_, preview layers (in search, catalogtree, wms import), feature layers for redlining, feature layers for measurements, etc. Those denoted with * are part of the layer list. For all of these, order needs to be managed and maintained by this service.
I have a strange behaviour on Chrome/Mac -> I can't click on the radiobutton (but can click on the layer name) in order to add the layer. Is it on all plattform ? |
The hover effect is active on the whole line, but the possibility to add the layer works only if the mouse is over the layer name. Is it possible to make that the possibilty to add a layer works like the hover effect ? |
Regarding the icons (category icons, checkbox), I'm using Font Awsome, which don't have round category icons (folded, unfolded) and don't have squared checkbox icons (checked, unchecked). They have what's currently visible. I've discussed it with Dave and he's ok with it. Regarding colors: yes, I'll need to adapt those. |
Regarding hover: on my machine, it works as you wish to have it. I've tested on Chrome, FF and IE9. Also, adding layers by clicking work in all 3. Apparently, it's a problem on Mac/Chrome |
Addressed all problems with latest commit. There's still the question about the lines going all the way to the left. But before we hack something, I'd like to discuss this with Dave. |
Another rebase done to have popup service. |
Added usage of popup service to display metadata information when clicking on the information button. Note: showing of metadata information will likely be refactored into a seperate service/directive, which can be used in other components (I think search component will also need it) But I would like to have those merged first before doing the refactoring. Please review and merge. |
return 'http://mf-chsdi30t.bgdi.admin.ch/rest/services/' + | ||
topicId + '/MapServer/' + | ||
layerId + '/getlegend?lang=' + | ||
lang + '&callback=JSON_CALLBACK'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be updated thanks to f520973
We took out modifications of 'val' inside watch function for 'val' which resulted in infite loops (which were gracefully treated by angular until now, but it was still bad). In place, we put the corresponding variables to the scope. We put the node and leaf html snippets in partials. To load this partials, we use ng-include snippets at runtime (they are hard coded in js, which will still changes), which are global to the directive module.
This commit changes the css styling to better reflect the specifications. It removes unneeded <div> elements from the html, which improves interaction. Fix chrome but.
…o container directive
Took responsibility to update the tree on language/topic change out of controller and put it into a new container directive. Thanks to @elemoine for this input. Changes based on other comments and did a new rebase. Ready to be reviewed again and merged. |
}, | ||
link: function(scope, element, attrs) { | ||
var currentTopic; | ||
scope.updateCatalogTree = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a reference to the updateCatalogTree function in the scope? Instead, can't updateCatalogTree just be local to the link function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely. I'll adapt.
In the example I see the catalog tree twice in the page? Is it expected? |
I'm seeing bugs related to the voidLayer:
This can be addressed with a separate PR, but I think an issue should be created right after merging this PR. |
Regarding example: yes, it is expected. Regarding bugs: there are quite a few other similar bugs too (for example, hovering over a background layer in the tree will remove it from the map). This is because we don't have a central instance doing our layer management (the layer manager we were speaking on Tuesday). I take responsibility to update catalog_tree once we have the layer manager in place. |
Something I don't like in the catalog tree UI: after selecting a layer in the catalog the layer gets displayed in the map but it disappears when I start moving my mouse. I know it reappears when the mouse goes out of the layer tree item, but I still find it quite confusing. Can be addressed later as well I think. |
This can easily be fixed. |
(function() { | ||
goog.provide('ga_catalogtree_directive'); | ||
|
||
var module = angular.module('ga_catalogtree_directive', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your module should depend on ga_translation.
My apologies. I had missed that. |
This is super impressive work! I'll merge this PR when you tell me again it's ready for merging. |
Thanks for the review and compliments. I adapted based on your recent comments. I think it can be merged....and I'm off to Gampel Open Air! |
Merged. Again, fantastic work! |
I think that this PR is now in a state where it makes sense to merge it into master.
What's done:
What's not done (to be done in future PR's):
Note:
CatalogService returns layers that are not defined in corresponding layers service. This means that certain layers are not addable from the catalogtree
Below is the original message of Marc