{"type":"Feature","cat_id":"372","properties":{"id":"80","cat":null,"podcat":null,"popupTitle":"првоерка","popupAdress":"првоерка","popupPhone":"0","popupTime":"првоерка","popupSite":"првоерка"},"geometry":{"type":"Point","coordinates":["29.08081054","47.64318610"]}}
[{"type":"Feature","cat_id":"372","properties":{"id":"79","cat":null,"podcat":null,"popupTitle":"Дамаскин Иван","popupAdress":"Одесская 145 кв 10","popupPhone":"77835004","popupTime":"круглосуточно","popupSite":"999pmr.md"},"geometry":{"type":"Point","coordinates":["29.30877685","47.25499987"]}}],[{"type":"Feature","cat_id":"372","properties":{"id":"80","cat":null,"podcat":null,"popupTitle":"првоерка","popupAdress":"првоерка","popupPhone":"0","popupTime":"првоерка","popupSite":"првоерка"},"geometry":{"type":"Point","coordinates":["29.08081054","47.64318610"]}}]
$posts = array(array( 'type'=> "Feature",
'cat_id'=>$cat_id,
'properties'=> array (
'id'=> $id,
'cat'=> $cat,
'podcat'=> $podcat,
'popupTitle'=> $popupTitle,
'popupAdress'=> $popupAdress,
'popupPhone'=> $popupPhone,
'popupTime'=> $popupTime,
'popupSite'=> $popupSite),
"geometry"=> array(
'type'=>'Point',
'coordinates'=> array($coordinates_d,$coordinates_s)
)
));
$markob = $mysqli->query("SELECT * FROM map_markers");
$posts = array();
while($row=$markob->fetch_assoc())
{
$id=$row['id'];
$cat_id=$row['cat_id'];
$cat=$row['cat'];
$podcat=$row['podcat'];
$popupTitle=$row['popupTitle'];
$popupAdress=$row['popupAdress'];
$popupPhone=$row['popupPhone'];
$popupTime=$row['popupTime'];
$popupSite=$row['popupSite'];
$coordinates_s=$row['coordinates_s'];
$coordinates_d=$row['coordinates_d'];
$posts[] = array( 'type'=> "Feature",
'cat_id'=>$cat_id,
'properties'=> array (
'id'=> $id,
'cat'=> $cat,
'podcat'=> $podcat,
'popupTitle'=> $popupTitle,
'popupAdress'=> $popupAdress,
'popupPhone'=> $popupPhone,
'popupTime'=> $popupTime,
'popupSite'=> $popupSite),
"geometry"=> array(
'type'=>'Point',
'coordinates'=> array($coordinates_d,$coordinates_s)
)
);
}
$fp = fopen('markers.json', 'w');
fwrite($fp, json_encode($posts, JSON_UNESCAPED_UNICODE));
fclose($fp);
[
{
"type": "Feature",
"properties": {
"id": "49",
"cat_id": "372",
"cat": null,
"podcat": null,
"popupTitle": "\u041c\u043e\u0439 \u0434\u043e\u043c",
"popupAdress": "\u041e\u0434\u0435\u0441\u0441\u043a\u0430\u044f 145 \u043a\u0432 10",
"popupPhone": "77835004",
"popupTime": "\u043a\u0440\u0443\u0433\u043b\u043e\u0441\u0443\u0442\u043e\u0447\u043d\u043e",
"popupSite": "999pmr.md"
},
"geometry": {
"type": "Point",
"coordinates": [
"29.65598344",
"46.84371511"
]
}
},
{
"type": "Feature",
"properties": {
"id": "51",
"cat_id": "32",
"cat": null,
"podcat": null,
"popupTitle": "\u0420\u0435\u0441\u0442\u043e\u0440\u0430",
"popupAdress": "\u0430\u0432\u043f\u0432\u0430\u043f\u0432\u0430",
"popupPhone": "575635",
"popupTime": "6",
"popupSite": "\u0430\u0446\u043f\u0440\u0446\u043a"
},
"geometry": {
"type": "Point",
"coordinates": [
"29.49279785",
"47.03643850"
]
}
}
]