Skip to content

Commit

Permalink
Merge pull request #46 from vonsogt/master
Browse files Browse the repository at this point in the history
Fix feature getCurrentPosition
  • Loading branch information
jxlwqq authored Dec 7, 2021
2 parents 878fd40 + c85089a commit 01eeb93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resources/views/latlong.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<div class="row">
<div class="col-md-3">
<input id="{{$id['lat']}}" name="{{$name['lat']}}" class="form-control" value="{{ old($column['lat'], $value['lat']) }}" {!! $attributes !!} />
<input id="{{$id['lat']}}" name="{{$name['lat']}}" class="form-control" value="{{ old($column['lat'], $value['lat'] ?? null) }}" {!! $attributes !!} />
</div>
<div class="col-md-3">
<input id="{{$id['lng']}}" name="{{$name['lng']}}" class="form-control" value="{{ old($column['lng'], $value['lng']) }}" {!! $attributes !!} />
<input id="{{$id['lng']}}" name="{{$name['lng']}}" class="form-control" value="{{ old($column['lng'], $value['lng'] ?? null) }}" {!! $attributes !!} />
</div>

@if($provider != 'yandex')
Expand Down
5 changes: 3 additions & 2 deletions src/Map/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Google extends AbstractMap
/**
* @var string
*/
protected $api = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=%s&libraries=places';
protected $api = '//maps.googleapis.com/maps/api/js?v=3.exp&key=%s&libraries=places';

/**
* {@inheritdoc}
Expand Down Expand Up @@ -42,6 +42,7 @@ function init(name) {
lng: position.coords.longitude
};
map.setCenter(pos);
marker.setPosition(pos);
lat.val(position.coords.latitude);
lng.val(position.coords.longitude);
Expand Down Expand Up @@ -96,4 +97,4 @@ function init(name) {
})();
EOT;
}
}
}

0 comments on commit 01eeb93

Please sign in to comment.