mirror of
https://github.com/KevinMidboe/nova-map-fields.git
synced 2026-04-26 00:43: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)
|
public function resolveAttribute($resource, $attribute = null)
|
||||||
{
|
{
|
||||||
return json_decode($resource->{$attribute});
|
$value = $resource->{$attribute};
|
||||||
|
|
||||||
return [
|
if (is_array($value)) {
|
||||||
'lat' => $resource->{$this->meta['latitudeField']},
|
return $value;
|
||||||
'lng' => $resource->{$this->meta['longitudeField']},
|
}
|
||||||
];
|
|
||||||
|
return json_decode($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user