-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heat map capability #111
Comments
Hi there, Yes this is certainly possible, try something along the lines of: Controller.php: public function index()
{
Mapper::map(37.775, -122.434, ['zoom' => 13, 'marker' => true, 'type' => MapperBase::TYPE_SATELLITE, 'eventBeforeLoad' => 'initiliseHeatmap(map_0);']);
return view('view');
} view.blade.php: <script type="text/javascript">
function initiliseHeatmap(map)
{
heatmap = new google.maps.visualization.HeatmapLayer({
data: [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng(37.782842, -122.443688),
new google.maps.LatLng(37.782919, -122.442815),
new google.maps.LatLng(37.782992, -122.442112),
new google.maps.LatLng(37.783100, -122.441461),
new google.maps.LatLng(37.783206, -122.440829),
new google.maps.LatLng(37.783273, -122.440324),
new google.maps.LatLng(37.783316, -122.440023),
new google.maps.LatLng(37.783357, -122.439794),
new google.maps.LatLng(37.783371, -122.439687),
new google.maps.LatLng(37.783368, -122.439666),
new google.maps.LatLng(37.783383, -122.439594),
new google.maps.LatLng(37.783508, -122.439525),
new google.maps.LatLng(37.783842, -122.439591),
new google.maps.LatLng(37.784147, -122.439668),
new google.maps.LatLng(37.784206, -122.439686),
new google.maps.LatLng(37.784386, -122.439790),
new google.maps.LatLng(37.784701, -122.439902)
],
map: map
});
}
</script> javascript.blade.php: @if (!$view->shared('javascript', false))
@if ($view->share('javascript', true)) @endif
@if ($options['async'])
<script async defer type="text/javascript" src="//maps.googleapis.com/maps/api/js?v={!! $options['version'] !!}®ion={!! $options['region'] !!}&language={!! $options['language'] !!}&key={!! $options['key'] !!}&signed_in={!! $options['user'] ? 'true' : 'false' !!}&libraries=places,visualization&callback=initialize_method"></script>
@else
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v={!! $options['version'] !!}®ion={!! $options['region'] !!}&language={!! $options['language'] !!}&key={!! $options['key'] !!}&signed_in={!! $options['user'] ? 'true' : 'false' !!}&libraries=places,visualization"></script>
@endif
@if ($options['cluster'])
<script type="text/javascript" src="//googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js"></script>
@endif
@if ($options['async'])
<script type="text/javascript">
var initialize_items = [];
function initialize_method() {
initialize_items.forEach(function(item) {
item.method();
});
}
</script>
@endif
@endif |
Using your suggested solution leads to |
Can this package be used with heat maps?
https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap
The text was updated successfully, but these errors were encountered: