How to programmatically set a Smart Map address field in plugin I have a console command plugin that needs to periodically go and fetch property data via API and import it into Craft. I can pull in basic property information but when it comes to importing the data into Smart Map field I'm a bit lost as how to format the data so that it saves correctly. Has anyone had to do this before?

Edit:

I don't think the console command part should make much difference. Basically I am trying to save a smartmapfield on my entry. From the API I am using I get a string with the full address. I first extract the postcode and then use the smartmap plugin to get the Lat and Lng values:

$postcode = $matches[0]; 

//Look up Latitude and Longitude from Google API

$response = craft()-&gt;smartMap-&gt;lookupCoords($postcode);
$lat = $response['lat'];
$lng = $response['lng'];


What I am not sure of is how to format this data so that it can be saved to the entry. So for standard fields thats straight forward:

$entry-&gt;getContent()-&gt;title = $property['RoomName'];


How do I do this for my smartmap field?
I figured it out, didn't realise all I had to do was pass array like so:

$entry-&gt;getContent()-&gt;address = array('lat' =&gt; $lat, 'lng' =&gt; $lng, 'street1' =&gt; $street1, 'zip' =&gt; $postcode);