You can add multiple Polylines
directly onto the map to draw separate tracks like this:
track1 = new nokia.maps.map.Polyline(coords, {
pen: {
strokeColor: "#22CA",
lineWidth: 5
},
arrows: true
});
track2 = new nokia.maps.map.Polyline(coords, {
pen: {
strokeColor: "#22CA",
lineWidth: 5
},
arrows: true
});
map.objects.addAll([track1, track2]);
Alternatively you could use a container to separate out the MapObjects
into logical collections e.g.:
var container1 = new nokia.maps.map.Container();
container2 = new nokia.maps.map.Container(),
map.objects.add(container1);
map.objects.add(container2);
// Add Objects to container 1.
container1.objects.addAll([track1, markerA, markerB]);
// Add Other Objects to container 2.
container1.objects.addAll([track2, markerX, markerY]);
You can then retrieve the various MapObjects
with the Container using the OList interface.
Since this is JavaScript, there is no problem with adding additional properties directly onto the Polyline
objects if you wish:
polyline = new nokia.maps.map.Polyline(coords, {
myCustomProperty : "I like Thursdays",
mySecondCustomId : "Thurs",
pen: {
strokeColor: "#22CA",
lineWidth: 5
},
arrows: true
});