Closed JcDenton86 closed 7 years ago
hello,can you tell me have you resolve this problem,and how
Hi, yes I found how to make it work properly. Below is the body of the function that creates the styles of each marker and appends it to the response array.
this.fetchFromREST = function(){
return $q(function(resolve, reject) {
$http.get("http://serverApiUrl/",{},{},function(response){
var resp = JSON.parse(response.data);
angular.forEach(resp, function(value, key) {
resp[key].style = new ol.style.Style({
image: new ol.style.Circle({
radius: 5,
stroke: new ol.style.Stroke({
color: '#000'
}),
fill: new ol.style.Fill({
color: value.color
})
})
});
});
resolve(resp);
},function(error){console.log(error);reject(error);});
});
};
Hello,
Trying to add markers which are fetched from API like this:
HTML
JavaScript
console.log(map.markers)
is fine but the markers are not showing up on the map. Can anyone help?