podio / podio-dotnet

Podio .NET client
MIT License
19 stars 39 forks source link

LocationField.cs - Add Setters to the Lat\Lng properties #30

Closed aztommylee closed 7 years ago

aztommylee commented 7 years ago

Since adding a Location into Podio doesn't trigger any geocoding (unless the Location is added through the Podio UI), I would like to submit Latitude & Longitude along with the address string through the API. This allows me to use my own geocoding service to update Podio locations.

AjmalVh commented 7 years ago

Does Podio REST API support setting a location field by latitude and longitude. have you tried?

aztommylee commented 7 years ago

Yes, it's available. It's actually already documented in the PHP SDK. Here's the example that they give:

http://podio.github.io/podio-php/fields/#locationgoogle-maps-field

$item = PodioItem::get_basic(123); $field_id = 'location';

// Set using array $item->fields[$field_id]->values = array( 'value' => '650 Townsend St., San Francisco, CA 94103', 'lat' => 37.7710325, 'lng' => -122.4033069 );

// You can also set just the text part of the location: $item->fields[$field_id]->text = '650 Townsend St., San Francisco, CA 94103';

AjmalVh commented 7 years ago

Thanks 👍