mirror of
https://github.com/KevinMidboe/nova-map-fields.git
synced 2026-04-25 00:13:40 +00:00
Compare commits
1 Commits
feat/trips
...
024010b867
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
024010b867 |
@@ -29,11 +29,12 @@ class Polyline extends MapField
|
||||
*/
|
||||
public function resolveAttribute($resource, $attribute = null)
|
||||
{
|
||||
return json_decode($resource->{$attribute});
|
||||
$value = $resource->{$attribute};
|
||||
|
||||
return [
|
||||
'lat' => $resource->{$this->meta['latitudeField']},
|
||||
'lng' => $resource->{$this->meta['longitudeField']},
|
||||
];
|
||||
if (is_array($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return json_decode($value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user