Permalink
Browse files

Allowing icons to be scaled via a size array or value.

  • Loading branch information...
Bradley Cornford
Bradley Cornford committed Sep 12, 2017
1 parent 9f9db1a commit 52b67e98ca2d5e1482fcfd084e0f02826feae98b
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/views/marker.blade.php
View
@@ -41,7 +41,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
});

0 comments on commit 52b67e9

Please sign in to comment.