This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(markers,paths,geojson,watchOptions): More flexible watch options…
… and more watch-options has been expanded to include paths and redesigned to handle more types of watching. `markersWatchOptions` and `geojsonWatchOptions` are no longer supported. Instead, this direcitve now supports the `watch-options` attribute, which takes an object that contains the watch options for each map element type: ``` watchOptions = { markers: <markerWatchOptions>, geojson: <geojsonWatchOptions>, paths: <pathsWatchOptions> } ``` The watch options for these map element types looks like: ``` { type: <watchTypes>, individual: { type: <watchTypes> } } ``` `<watchTypes>` can be one of: -`'watch'`: `$scope.$watch` with no deep watch on the object -`'watchDeep'`: `$scope.$watch` with a deep watch on the object -`'watchCollection'`: `$scope.$watchCollection` on the object -`null`: Do not watch the collection (note: you must explicity `null`, `undefined` will not work). I've removed support for the directive attributes `watch-markers` and `watch-paths`. While these make sense when set to false, it's ambiguous how they should function when set to `true`, especially when combined with `watch-options`. There are some other minor fixes in this commit (fixing breaking examples, and another small bug). BREAKING CHANGE: `markersWatchOptions`, `geojsonWatchOptions`, `watch-markers`, and `watch-paths` are no longer supported. The format of the watch options has also changed. Before: ``` <leaflet defaults='defaults' markers-watch-options='markerWatchOptions'> ``` After: ``` <leaflet defaults='defaults' watch-options='watchOptions'> <script> $scope.watchOptions = { markers: <watchOptions> } </script> ``` The same can be said for `geojson`. WatchOptions. `shouldWatch` and `isDeep` are no longer supported, but the same behaviour can be achieved: `shouldWatch: true`, `isDeep: true` = `type = 'watchDeep'` `shouldWatch: true`, `isDeep: false` = `type = 'watch'` `shouldWatch: false`, `isDeep: false` = `type = null` `shouldWatch: false`, `isDeep: true` = `type = null` Furthermore, Before: ``` <leaflet watch-markers='false'> ``` After: ``` <leaflet watch-options='watchOptions'> <script> $scope.watchOptions = { markers: { type: null, individual: { type: null } } }; </script> ``` `watch-paths='false'` can be achieved in a similar manner.
- Loading branch information
Showing
25 changed files
with
474 additions
and
360 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.