You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
I am trying to add tilelayers combined with the Markercluster plugin.
This is working and provided as documentation:
...
use dosamigos\leaflet\layers\TileLayer;
use dosamigos\leaflet\controls\Layers;
...
$center = new LatLng(['lat' => (float)$latitude, 'lng' => (float)$longitude]);
I do not understand how I can set grouplayers. How can I add records to a group layer?
I have:
$layerGroups = [];
foreach($uniqegroup as $line) {
$layerGroups[$line['name']] = new LayerGroup(['name' => $line['id'] ]);
}
This will set the layersgroups and give them a name. But it doesn't link the items to it.
So I missing the concept to add the individual item to a group. How should I do that?
I am trying to add tilelayers combined with the Markercluster plugin.
This is working and provided as documentation:
...
use dosamigos\leaflet\layers\TileLayer;
use dosamigos\leaflet\controls\Layers;
...
$center = new LatLng(['lat' => (float)$latitude, 'lng' => (float)$longitude]);
$openstreet = new TileLayer([
'urlTemplate' => 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
'clientOptions' => [
'© OpenStreetMap contributors'
]
]);
$arogis = new TileLayer([
'urlTemplate' => 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
'clientOptions' => [
'© OpenStreetMap contributors'
]
]);
$baseLayers = new Layers();
$baseLayers->setBaseLayers(['Card' => $openstreet, 'Photo' => $arogis]);
$leaflet = new LeafLet([
'tileLayer' => $openstreet,
'center' => $center,
'zoom'=> 13,
]);
$leaflet
->setControls([$baseLayers]);
Adding Markercluster works also.
$cluster = new MarkerCluster([
'url' => Url::to(['you rur lreturning json']),
]);
and changing $leaflet to:
$leaflet
->setControls([$baseLayers]);
$leaflet
->installPlugin($cluster);
Do to:
a. Setting grouplayers
b. Combining groupslayer control and MarkerCluster.
The text was updated successfully, but these errors were encountered: