Answer the question
In order to leave comments, you need to log in
How to remove quotes of map coordinates in json_encode?
Hello, there is a code:
$json_data = array("type"=>"Feature",
"id"=>$arItem['ID'],
"geometry"=>array(
"type"=>"Polygon",
"coordinates"=>[$coords]),
"properties"=>array(
"balloonContentHeader"=>"".$arItem['NAME']."",
"balloonContentBody"=>"",
"balloonContentFooter"=>"",
"hintContent"=>"".$arItem['NAME']."",
"type"=>"".$arItem['PROPERTY_TYPE_POINT_ENUM_ID']."")
);
$encode_data = json_encode($json_data);
{"type": "FeatureCollection","features": [{"type":"Feature","id":"279","geometry":{"type":"Polygon","coordinates":[""]},"properties":{"balloonContentHeader":"\u041f\u043b\u043e\u0449\u0430\u0434\u043a\u0430 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435","balloonContentBody":"","balloonContentFooter":"","hintContent":"\u041f\u043b\u043e\u0449\u0430\u0434\u043a\u0430 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435","type":"1"}}]}
"coordinates":[]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question