Bonjour à tous,

J'essaye d'dapter un code et j'ai presque réussi.
Sauf que les données que je récupère de ma base de donnée sont retournée en objet.

Si je fait un console.log de data, j'ai ceci

data:
Object { properties: (5) […] }
custom-map.js:270:21
Code jquery : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
 
data: 
{
  "properties": [
    {
      "id": 1,
      "station": "Zone a1",
      "la": 46.1861,
      "lo": 5.997,
      "da": "2020-11-11 23:46:47",
      "al": 600,
      "te_s": "TBD",
      "te_b": "TBD",
      "te_m": "TBD",
      "te_t": "TBD"
    },
    {
      "id": 2,
      "station": "zone a2",
      "la": 46.1859,
      "lo": 5.9969,
      "da": "2020-11-11 23:49:38",
      "al": 4000,
      "te_s": "TBD",
      "te_b": "TBD",
      "te_m": "TBD",
      "te_t": "TBD"
    },
    {
      "id": 3,
      "station": "zone a3",
      "la": 46.1856,
      "lo": 5.9969,
      "da": "2020-11-11 23:51:16",
      "al": 400,
      "te_s": "TBD",
      "te_b": "TBD",
      "te_m": "TBD",
      "te_t": "TBD"
    },
    {
      "id": 4,
      "station": "Zone b1",
      "la": 46.1854,
      "lo": 5.997,
      "da": "2020-11-11 23:53:00",
      "al": 450,
      "te_s": "TBD",
      "te_b": "TBD",
      "te_m": "TBD",
      "te_t": "TBD"
    },
    {
      "id": 5,
      "station": "Zone b2",
      "la": 46.186,
      "lo": 5.9972,
      "da": "2020-11-11 23:54:52",
      "al": 450,
      "te_s": "TBD",
      "te_b": "TBD",
      "te_m": "TBD",
      "te_t": "TBD"
    }
  ]
}

Dans l'exemple de code le format est le suivant

Code jquery : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
       var locations = [
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.87, 2.29, "property-detail.html", "assets/img/properties/property-01.jpg", "assets/img/property-types/apartment.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.866876, 2.309639, "property-detail.html", "assets/img/properties/property-02.jpg", "assets/img/property-types/apartment.png"],
 
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.874796, 2.299275, "property-detail.html", "assets/img/properties/property-03.jpg", "assets/img/property-types/construction-site.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.864194, 2.288868, "#", "assets/img/properties/property-04.jpg", "assets/img/property-types/cottage.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.881187, 2.276938, "#", "assets/img/properties/property-06.jpg", "assets/img/property-types/garage.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.859098, 2.423515, "#", "assets/img/properties/property-08.jpg", "assets/img/property-types/houseboat.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.872296, 2.287796, "property-detail.html", "assets/img/properties/property-07.jpg", "assets/img/property-types/land.png"],
 
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.874457, 2.254386, "property-detail.html", "assets/img/properties/property-09.jpg", "assets/img/property-types/single-family.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.875191, 2.252412, "property-detail.html", "assets/img/properties/property-10.jpg", "assets/img/property-types/villa.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.864352, 2.257218, "property-detail.html", "assets/img/properties/property-11.jpg", "assets/img/property-types/vineyard.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.858648, 2.273526, "property-detail.html", "assets/img/properties/property-12.jpg", "assets/img/property-types/warehouse.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.856277, 2.264256, "property-detail.html", "assets/img/properties/property-13.jpg", "assets/img/property-types/industrial-site.png"],
 
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.859988, 2.252991, "property-detail.html", "assets/img/properties/property-01.jpg", "assets/img/property-types/apartment.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.856954, 2.283912, "property-detail.html", "assets/img/properties/property-05.jpg", "assets/img/property-types/condominium.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.879268, 2.270672, "property-detail.html", "assets/img/properties/property-06.jpg", "assets/img/property-types/construction-site.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.875925, 2.3239098, "property-detail.html", "assets/img/properties/property-03.jpg", "assets/img/property-types/cottage.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.870393, 2.327771, "property-detail.html", "assets/img/properties/property-04.jpg", "assets/img/property-types/houseboat.png"],
 
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.880328, 2.307258, "property-detail.html", "assets/img/properties/property-08.jpg", "assets/img/property-types/land.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.880284, 2.306721, "property-detail.html", "assets/img/properties/property-09.jpg", "assets/img/property-types/single-family.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.860342, 2.304597, "property-detail.html", "assets/img/properties/property-10.jpg", "assets/img/property-types/vineyard.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.852549, 2.329574, "property-detail.html", "assets/img/properties/property-11.jpg", "assets/img/property-types/warehouse.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.857124, 2.316699, "property-detail.html", "assets/img/properties/property-12.jpg", "assets/img/property-types/empty.png"],
 
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.869433, 2.315068, "property-detail.html", "assets/img/properties/property-13.jpg", "assets/img/property-types/apartment.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.885916, 2.297130, "property-detail.html", "assets/img/properties/property-01.jpg", "assets/img/property-types/industrial-site.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.893534, 2.276616, "property-detail.html", "assets/img/properties/property-02.jpg", "assets/img/property-types/construction-site.png"],
                ['3398 Lodgeville Road', "Golden Valley, MN 55427", "$28,000", 48.872570, 2.237349, "property-detail.html", "assets/img/properties/property-03.jpg", "assets/img/property-types/cottage.png"],
                ['2479 Murphy Court', "Minneapolis, MN 55402", "$36,000", 48.879344, 2.226191, "property-detail.html", "assets/img/properties/property-04.jpg", "assets/img/property-types/garage.png"],
            ];
 
            console.log("locations:",locations);

et locations m'affiche
locations:
Array(27) [ (8) […], (8) […], (8) […], (8) […], (8) […], (8) […], (8) […], (8) […], (8) […], (8) […], … ]
custom-map.js:309:21
Comment puis-je donc convertir l'objet data en un array, par exemple je veux que data soit converti dans var loc = array();.

Je crois bien qu'il y a une fonction qui va le faire, non?

Merci pour vos lumières!!