Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

FeatureLayer url attribute #55

Closed
wants to merge 6 commits into from
Closed

Conversation

willisd2
Copy link
Contributor

@willisd2 willisd2 commented May 6, 2015

This commit allows the url attribute on the FeatureLayer directive to accept either a url or a scope variable that holds the url value. Again, my apologies, this request contains both of my previous commits...

The current implementation allows an array of strings to be passed to
the loader, but $q Resolves only support 1 parameter.  Therefore, in
your .then() function you would only ever get the first module in your
list.  The loader will now take a callback function that will be passed
all of the requested modules.  The original implementation is also
intact so as not to break an application if someone decides to update to
this version.
…iables as the source of the url to prevent hardcoding it in the html
…areas where angular uses dependency injection to inject dependencies so that it supports minification.
@willisd2
Copy link
Contributor Author

I noticed that the minified version of this directive wasn't working. I included a fix for that in this pull request.

Sorry about this, I didn't realize that the angular dependency injection syntax was applied to the project in the gulp task. However, I did have an issue with the minified version that has since gone away. I think this may have been due to a *.map file reference that showed up in the minified version of the file.

…ged the areas where angular uses dependency injection to inject dependencies so that it supports minification."

This reverts commit 439d5ed.
@tomwayson
Copy link
Member

@willisd2

w/r/t getting the feature layer url from scope (instead of in-lined in the attribute), is there a reason that we can't just use something like url="{{myScopeObj.url}}"?

For example, see: http://jsfiddle.net/tomwayson/1kb54dxo/

@willisd2
Copy link
Contributor Author

Not 100% sure at the moment. I was trying to play around with it on that fiddle, but it's a little quirky and only seems to work with a full page reload. I think the reason I went down that route was because it allows your url attribute to be dynamic. In otherwords, if your scope variable for the url is tied to a element that allows you to select a different url, it will pick up on that and load whatever new feature layer was selected.

@tomwayson
Copy link
Member

Good point. Updating the scope variable will not update the layer in the current implementation. See: http://jsfiddle.net/tomwayson/1kb54dxo/8/

However, unless I'm missing something (entirely possible), I don't see a watch or anything in this PR that would enable that behavior either.

At this point, I'm thinking a better way to handle updating layers would be #51. If that works for you, I think we can close this PR (since the other commits you made have already been merged).

If you are still interested in the behavior of being able to change a layer's URL after it's been added to the map (instead of adding/removing layers as in #51) then please open a new issue or PR.

Thanks again for your contributions!

@tomwayson
Copy link
Member

@willisd2 I've merged #51, which allows binding the url variable to either a string literal or a scope variable, so I'm closing this PR.

@tomwayson tomwayson closed this Sep 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants