I have the following problem which I can't solve for trying for 3 days now. I have an JSON array:
var geojson = {
type: 'FeatureCollection',
features: [
{
"type": "Feature",
"geometry": {
"coordinates": [
5.140439,
51.686608
],
"type": "Point"
},
"properties": {
"title": "TEST1",
"rentals": true,
"tackleshop": false,
"fuel": false,
"marker-color": "#1087bf",
"marker-size": "large",
"marker-symbol": "harbor"
}
},
{
"type": "Feature",
"geometry": {
"coordinates": [
5.134060,
51.686890
],
"type": "Point"
},
"properties": {
"title": "TEST2",
"rentals": true,
"tackleshop": false,
"fuel": true,
"marker-color": "#1087bf",
"marker-size": "large",
"marker-symbol": "harbor"
}
},
{
"type": "Feature",
"geometry": {
"coordinates": [
5.133729,
51.681425
],
"type": "Point"
},
"properties": {
"title": "TEST3",
"rentals": false,
"tackleshop": true,
"fuel": true,
"marker-color": "#1087bf",
"marker-size": "large",
"marker-symbol": "harbor"
}
}
]
};
What I have been tested now:
$.each(geojson, function() {
$.each(this, function(key, value) {
$.each(this, function(value, featuress) {
console.log(featuress.properties.title);
});
});
});
The result I want: I want a $.each which goes through this json array where I am able to display the variable for as example: "title" for each feature.
Who can help me out? Cheers!