Skip to content

Commit bb19c44

Browse files
authored
#2 - Fixed issue with wrong count showing up in markers. Also fixed issue with wrong colors being used when multiple facets are drawn on the map. (#10)
1 parent 7fcad36 commit bb19c44

File tree

3 files changed

+19
-29
lines changed

3 files changed

+19
-29
lines changed

dist/ml-esri-maps-ng.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -399,24 +399,12 @@
399399
new Color([76, 230, 0, 0.75]) // lime-green
400400
];
401401

402-
// Outer symbol for group marker
403-
ctrl.oGrpSym = new SimpleMarkerSymbol()
404-
.setColor( ctrl.markerColors[0] )
405-
.setOutline(new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH))
406-
.setSize(45);
407-
408402
// Inner symbol for group marker
409403
ctrl.iGrpSym = new SimpleMarkerSymbol()
410404
.setColor( new Color([214, 214, 214, 0.50]) )
411405
.setOutline( new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH) )
412406
.setSize(25);
413407

414-
// Text symbol for group marker
415-
ctrl.textGrpSym = new TextSymbol()
416-
.setColor( new Color([0, 0, 0, 1.0]) )
417-
.setVerticalAlignment('middle')
418-
.setFont( new Font().setWeight(Font.WEIGHT_BOLD) );
419-
420408
// Handle layer updates based on current extent.
421409
ctrl.map.on('extent-change', function(evt) {
422410
ctrl.notifyExtentChange(evt);
@@ -527,7 +515,10 @@
527515

528516
// Outer shape
529517
graphic = {
530-
'symbol': ctrl.oGrpSym.setColor( ctrl.markerColors[ i % ctrl.markerColors.length ] ),
518+
'symbol': new SimpleMarkerSymbol()
519+
.setColor( ctrl.markerColors[ i % ctrl.markerColors.length ] )
520+
.setOutline(new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH))
521+
.setSize(45),
531522
'geometry': polygon.getCentroid()
532523
};
533524
graphic.symbol.setSize(outerSize);
@@ -545,7 +536,11 @@
545536

546537
// Text in marker
547538
var graphicText = {
548-
'symbol': ctrl.textGrpSym.setText(box.count),
539+
'symbol': new TextSymbol()
540+
.setColor( new Color([0, 0, 0, 1.0]) )
541+
.setVerticalAlignment('middle')
542+
.setFont( new Font().setWeight(Font.WEIGHT_BOLD) )
543+
.setText(box.count),
549544
'geometry': polygon.getCentroid()
550545
};
551546

dist/ml-esri-maps-ng.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ml-esri-search-map.directive.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,12 @@
116116
new Color([76, 230, 0, 0.75]) // lime-green
117117
];
118118

119-
// Outer symbol for group marker
120-
ctrl.oGrpSym = new SimpleMarkerSymbol()
121-
.setColor( ctrl.markerColors[0] )
122-
.setOutline(new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH))
123-
.setSize(45);
124-
125119
// Inner symbol for group marker
126120
ctrl.iGrpSym = new SimpleMarkerSymbol()
127121
.setColor( new Color([214, 214, 214, 0.50]) )
128122
.setOutline( new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH) )
129123
.setSize(25);
130124

131-
// Text symbol for group marker
132-
ctrl.textGrpSym = new TextSymbol()
133-
.setColor( new Color([0, 0, 0, 1.0]) )
134-
.setVerticalAlignment('middle')
135-
.setFont( new Font().setWeight(Font.WEIGHT_BOLD) );
136-
137125
// Handle layer updates based on current extent.
138126
ctrl.map.on('extent-change', function(evt) {
139127
ctrl.notifyExtentChange(evt);
@@ -244,7 +232,10 @@
244232

245233
// Outer shape
246234
graphic = {
247-
'symbol': ctrl.oGrpSym.setColor( ctrl.markerColors[ i % ctrl.markerColors.length ] ),
235+
'symbol': new SimpleMarkerSymbol()
236+
.setColor( ctrl.markerColors[ i % ctrl.markerColors.length ] )
237+
.setOutline(new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_DASH))
238+
.setSize(45),
248239
'geometry': polygon.getCentroid()
249240
};
250241
graphic.symbol.setSize(outerSize);
@@ -262,7 +253,11 @@
262253

263254
// Text in marker
264255
var graphicText = {
265-
'symbol': ctrl.textGrpSym.setText(box.count),
256+
'symbol': new TextSymbol()
257+
.setColor( new Color([0, 0, 0, 1.0]) )
258+
.setVerticalAlignment('middle')
259+
.setFont( new Font().setWeight(Font.WEIGHT_BOLD) )
260+
.setText(box.count),
266261
'geometry': polygon.getCentroid()
267262
};
268263

0 commit comments

Comments
 (0)