@@ -123,12 +123,18 @@ GMaps.prototype.drawRoute = function(options) {
123
123
error : options . error ,
124
124
callback : function ( e ) {
125
125
if ( e . length > 0 ) {
126
- self . drawPolyline ( {
126
+ var polyline_options = {
127
127
path : e [ e . length - 1 ] . overview_path ,
128
128
strokeColor : options . strokeColor ,
129
129
strokeOpacity : options . strokeOpacity ,
130
130
strokeWeight : options . strokeWeight
131
- } ) ;
131
+ } ;
132
+
133
+ if ( options . hasOwnProperty ( "icons" ) ) {
134
+ polyline_options . icons = options . icons ;
135
+ }
136
+
137
+ self . drawPolyline ( polyline_options ) ;
132
138
133
139
if ( options . callback ) {
134
140
options . callback ( e [ e . length - 1 ] ) ;
@@ -206,12 +212,18 @@ GMaps.prototype.drawSteppedRoute = function(options) {
206
212
var steps = route . legs [ 0 ] . steps ;
207
213
for ( var i = 0 , step ; step = steps [ i ] ; i ++ ) {
208
214
step . step_number = i ;
209
- self . drawPolyline ( {
215
+ var polyline_options = {
210
216
path : step . path ,
211
217
strokeColor : options . strokeColor ,
212
218
strokeOpacity : options . strokeOpacity ,
213
219
strokeWeight : options . strokeWeight
214
- } ) ;
220
+ } ;
221
+
222
+ if ( options . hasOwnProperty ( "icons" ) ) {
223
+ polyline_options . icons = options . icons ;
224
+ }
225
+
226
+ self . drawPolyline ( polyline_options ) ;
215
227
options . step ( step , ( route . legs [ 0 ] . steps . length - 1 ) ) ;
216
228
}
217
229
}
@@ -229,12 +241,18 @@ GMaps.prototype.drawSteppedRoute = function(options) {
229
241
var steps = options . route . legs [ 0 ] . steps ;
230
242
for ( var i = 0 , step ; step = steps [ i ] ; i ++ ) {
231
243
step . step_number = i ;
232
- self . drawPolyline ( {
244
+ var polyline_options = {
233
245
path : step . path ,
234
246
strokeColor : options . strokeColor ,
235
247
strokeOpacity : options . strokeOpacity ,
236
248
strokeWeight : options . strokeWeight
237
- } ) ;
249
+ } ;
250
+
251
+ if ( options . hasOwnProperty ( "icons" ) ) {
252
+ polyline_options . icons = options . icons ;
253
+ }
254
+
255
+ self . drawPolyline ( polyline_options ) ;
238
256
options . step ( step ) ;
239
257
}
240
258
}
@@ -252,12 +270,18 @@ GMaps.Route = function(options) {
252
270
this . steps = this . route . legs [ 0 ] . steps ;
253
271
this . steps_length = this . steps . length ;
254
272
255
- this . polyline = this . map . drawPolyline ( {
273
+ var polyline_options = {
256
274
path : new google . maps . MVCArray ( ) ,
257
275
strokeColor : options . strokeColor ,
258
276
strokeOpacity : options . strokeOpacity ,
259
277
strokeWeight : options . strokeWeight
260
- } ) . getPath ( ) ;
278
+ } ;
279
+
280
+ if ( options . hasOwnProperty ( "icons" ) ) {
281
+ polyline_options . icons = options . icons ;
282
+ }
283
+
284
+ this . polyline = this . map . drawPolyline ( polyline_options ) . getPath ( ) ;
261
285
} ;
262
286
263
287
GMaps . Route . prototype . getRoute = function ( options ) {
0 commit comments