bradcornford / Googlmapper

An easy way to integrate Google Maps with Laravel
MIT License
464 stars 142 forks source link

How can i show 6k markers in map? #341

Closed hermesalvesbr closed 4 years ago

hermesalvesbr commented 4 years ago

Hi,

I'm trying do show 6k markers in map, but the show only until 240 markers. Captura de Tela 2019-12-15 às 10 43 59

240 markers: Captura de Tela 2019-12-15 às 10 45 28

6k markers: Captura de Tela 2019-12-15 às 10 46 20

Message error: Uncaught SyntaxError: missing ) after argument list jquery-migrate-3.0.0.min.js:2 JQMIGRATE: Migrate is installed, version 3.0.0 2mapa:1 Unchecked runtime.lastError: The message port closed before a response was received.

bradcornford commented 4 years ago

Hi,

You probably want to create a map wit no markers, then on load, create an AJAX call to an endpoint to request the the markers, and add them that way. If you don't you'll end up with your browser hanging awaiting the response from the server with a large numbers of markers. Also performance of the map will be terrible if you dont use marker clusters.

hermesalvesbr commented 4 years ago

$mapper = Mapper::map(-7.5771271, -40.4983011, ['zoom' => 15, 'center' => false, 'marker' => true, 'type' => 'HYBRID', 'overlay' => 'TRAFFIC']); $resultado = Referencia::select('*')->limit(2000)->get();

Marker = true, but didn't work.

hermesalvesbr commented 4 years ago

$mapper = Mapper::map(-7.5771271, -40.4983011); $resultado = Referencia::select('*')->limit(3000)->get(); // foreach ($resultado as $value) { $conteudo = $value->placa ." <br/>". $value->barramento ." <br/>Endereço: ". $value->endereco; Mapper::informationWindow($value->latitude, $value->longitude, $conteudo); } return view('mapa');

I'm trying this, but didn't work again.

bradcornford commented 4 years ago

See: https://github.com/bradcornford/Googlmapper/issues/245