Skip to content

Commit e07ea18

Browse files
committed
Merge pull request #389 from OpenGeoscience/plugin-size-arg
Allow constants for size argument in jquery plugin
2 parents cc96192 + 08d6371 commit e07ea18

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/plugin/jquery-plugin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
* renderer: 'vgl',
145145
* features: [{
146146
* type: 'point',
147-
* size: 5,
147+
* radius: 5,
148148
* position: function (d) { return {x: d.geometry.x, y: d.geometry.y} },
149149
* fillColor: function (d, i) { return i < 5 ? 'red' : 'blue' },
150150
* stroke: false
@@ -160,7 +160,7 @@
160160
* features: [{
161161
* data: [...],
162162
* type: 'point',
163-
* size: 5,
163+
* radius: 5,
164164
* position: function (d) { return {x: d.geometry.x, y: d.geometry.y} },
165165
* fillColor: function (d, i) { return i < 5 ? 'red' : 'blue' },
166166
* stroke: false
@@ -226,8 +226,8 @@
226226
* @property {number} radius
227227
* Radius of the circle in pixels (ignored when <code>size</code>
228228
* is present)
229-
* @property {number} size
230-
* A numerical value mapped affinely to a radius in the range [5,20]
229+
* @property {function} size
230+
* A function returning a numerical value
231231
* @property {boolean} fill Presence or absence of the fill
232232
* @property {color} fillColor Interior color
233233
* @property {float} fillOpacity Opacity of the interior <code>[0,1]</code>
@@ -346,7 +346,7 @@
346346
var scl;
347347
if (feature.type === 'point') {
348348
if (feature.size) {
349-
feature._size = feature.size;
349+
feature._size = geo.util.ensureFunction(feature.size);
350350
} else if (feature.size === null) {
351351
delete feature._size;
352352
}

testing/test-cases/selenium-tests/jqueryPlugin/include.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ window.startTest = function (done) {
4242
strokeColor: 'midnightblue',
4343
strokeWidth: 5,
4444
strokeOpacity: 0.5
45+
}, {
46+
type: 'point',
47+
data: [{x: 10, y: 15}],
48+
size: 10000,
49+
fillColor: 'black',
50+
strokeColor: 'lightgrey',
51+
strokeWidth: 2
4552
}]
4653
}]
4754
});

testing/test-cases/selenium-tests/jqueryPlugin/testJQueryPlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class base(object):
88
testCase = ('jqueryPlugin',)
9-
testRevision = 1
9+
testRevision = 2
1010

1111
def loadPage(self):
1212
self.resizeWindow(800, 600)

0 commit comments

Comments
 (0)