所以我想变成JSON的代码如下
var locationData = [];
locationData['lat'] = position.coords.latitude;
locationData['long'] = position.coords.longitude;
locationData['address']['road'] = data['address']['road'];
locationData['address']['suburb'] = data['address']['suburb'];
locationData['address']['city'] = data['address']['city'];
locationData['address']['county'] = data['address']['county'];
locationData['address']['state'] = data['address']['state'];
locationData['address']['postcode'] = data['address']['postcode'];
locationData['address']['country'] = data['address']['country'];
locationData['address']['country_code'] = data['address']['country_code'];
但是当我运行它时,它并没有提醒我它已经成功