Permalink
Browse files

Fixing issue where locate true when marker is true doesn't move marke…

…r to current location.
  • Loading branch information...
Bradley Cornford
Bradley Cornford committed Oct 24, 2017
1 parent fcc7df7 commit dabf03c37da2d194d283975b2a91daa6380c488b
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/views/marker.blade.php
@@ -13,6 +13,14 @@
@endif
@if ($options['locate'] && $options['marker'])
if (typeof navigator !== 'undefined' && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
marker_0.setPosition(new google.maps.LatLng(position.coords.latitude, position.coords.longitude));
});
}
@endif
var markerPosition_{!! $id !!} = new google.maps.LatLng({!! $options['latitude'] !!}, {!! $options['longitude'] !!});
var marker_{!! $id !!} = new google.maps.Marker({

0 comments on commit dabf03c

Please sign in to comment.