Skip to content

Commit

Permalink
Allowing icons to be scaled via a size array or value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradley Cornford committed Sep 12, 2017
1 parent 99f60da commit 0cacade
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/views/marker.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,22 @@
scale: {{ $options['scale'] }}
}
@else
icon: {{ json_encode((is_array($options['icon']) ? (array) $options['icon'] : (string) $options['icon'])) }}
icon:
@if (is_array($options['icon']) && isset($options['icon']['url']))
{
url: {{ json_encode((string) $options['icon']['url']) }},

@if (isset($options['icon']['size']))
@if (is_array($options['icon']['size']))
scaledSize: new google.maps.Size({{ $options['icon']['size'][0] }}, {{ $options['icon']['size'][1] }})
@else
scaledSize: new google.maps.Size({{ $options['icon']['size'] }}, {{ $options['icon']['size'] }})
@endif
@endif
}
@else
{{ json_encode($options['icon']) }}
@endif
@endif
});

Expand Down

0 comments on commit 0cacade

Please sign in to comment.