These are chat archives for tombatossals/angular-leaflet-directive

12th
Oct 2015
213374you
@213374you
Oct 12 2015 20:25
is it possible for markers to be an array, rather than an object with a collection of objects?
Thnx!
nmccready
@nmccready
Oct 12 2015 20:29
@213374you yes either should work
213374you
@213374you
Oct 12 2015 20:31

So, rather than

angular.extend($scope.data, {
markers: {
m1: {
lat: 51.505,
lng: -0.09,
compileMessage: false,
message: "I'm a static marker",
},
m2: {
lat: 51,
lng: 0,
focus: true,
message: "<div ng-include src=\"'views/template.html'\"></div>",
draggable: true,
},
m3: {
lat: 51,
lng: -1,
getMessageScope: function () { return $scope; },
message: "<p>{{data.angularInterpolatedMessage}}</p>",
compileMessage: true
}
}
});
};

is it possible to do:

angular.extend($scope.data, {
markers: [
m1: {
lat: 51.505,
lng: -0.09,
compileMessage: false,
message: "I'm a static marker",
},
m2: {
lat: 51,
lng: 0,
focus: true,
message: "<div ng-include src=\"'views/template.html'\"></div>",
draggable: true,
},
m3: {
lat: 51,
lng: -1,
getMessageScope: function () { return $scope; },
message: "<p>{{data.angularInterpolatedMessage}}</p>",
compileMessage: true
}
]
});
};

Sorry for spam! I am new to gitter and not sure how to put in code
@nmccready Thank you! This makes my life much easier