-
Notifications
You must be signed in to change notification settings - Fork 632
Add support for Leaflet plugin 'Leaflet.vector-markers' #942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nmccready
merged 4 commits into
tombatossals:master
from
molehillrocker:feature/Leaflet.vector-markers
Sep 28, 2015
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
eb386a1
Add support for Leaflet plugin 'Leaflet.vector-markers'
b0a54dd
Let Bower update the bower.json file when updating the dependencies
253eafe
Use proper library name in bower.json and use pure version number also
aea1742
Add unit test that verifies loading of the plugin and marker creation
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
'use strict'; | ||
|
||
/*jshint -W117 */ | ||
/*jshint globalstrict: true*/ | ||
/* jasmine specs for directives go here */ | ||
|
||
describe('Plugin: VectorMarkers', function() { | ||
var $compile, $rootScope, scope, leafletData, leafletHelpers; | ||
|
||
beforeEach(module('leaflet-directive')); | ||
beforeEach(inject(function(_$compile_, _$rootScope_, _leafletData_, _leafletHelpers_){ | ||
$compile = _$compile_; | ||
$rootScope = _$rootScope_; | ||
scope = $rootScope.$new(); | ||
leafletData = _leafletData_; | ||
leafletHelpers = _leafletHelpers_; | ||
})); | ||
|
||
afterEach(inject(function($rootScope) { | ||
$rootScope.$apply(); | ||
})); | ||
|
||
it('should load plugin for the vector markers', function(){ | ||
var plugin = leafletHelpers.VectorMarkersPlugin; | ||
|
||
expect(plugin).toBeDefined(); | ||
expect(plugin.isLoaded()).toBeTruthy(); | ||
}); | ||
|
||
it('should create a new vector marker', function() { | ||
var myMarker = { | ||
lat: 51, | ||
lng: 0, | ||
icon: { | ||
type: 'vectorMarker', | ||
icon: 'tag', | ||
markerColor: 'red' | ||
} | ||
}; | ||
|
||
angular.extend(scope, { | ||
markers : { | ||
myMarker: myMarker | ||
} | ||
}); | ||
|
||
var element = angular.element('<leaflet markers="markers"></leaflet>'); | ||
element = $compile(element)(scope); | ||
scope.$digest(); | ||
|
||
var plugin = leafletHelpers.VectorMarkersPlugin; | ||
|
||
leafletData.getMarkers().then(function(markers) { | ||
expect(markers).toBeDefined(); | ||
expect(markers.myMarker).toBeDefined(); | ||
expect(plugin.is(markers.myMarker.options.icon)).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
it('icon should differ from a common marker\'s icon', function() { | ||
var commonMarker = { | ||
lat: 51, | ||
lng: 0, | ||
icon: {} | ||
}; | ||
var vectorMarker = { | ||
lat: 51, | ||
lng: 0, | ||
icon: { | ||
type: 'vectorMarker', | ||
icon: 'tag', | ||
markerColor: 'red' | ||
} | ||
}; | ||
|
||
angular.extend(scope, { | ||
markers : { | ||
commonMarker: commonMarker, | ||
vectorMarker: vectorMarker | ||
} | ||
}); | ||
|
||
var element = angular.element('<leaflet markers="markers"></leaflet>'); | ||
element = $compile(element)(scope); | ||
scope.$digest(); | ||
|
||
var plugin = leafletHelpers.VectorMarkersPlugin; | ||
|
||
leafletData.getMarkers().then(function(markers) { | ||
expect(markers).toBeDefined(); | ||
expect(markers.commonMarker).toBeDefined(); | ||
expect(markers.vectorMarker).toBeDefined(); | ||
expect(plugin.is(markers.commonMarker.options.icon)).toBeFalsy(); | ||
expect(plugin.is(markers.vectorMarker.options.icon)).toBeTruthy(); | ||
expect(plugin.equal(markers.commonMarker.options.icon, markers.vectorMarker.options.icon)).toBeFalsy(); | ||
}); | ||
}); | ||
|
||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍