{"id":18850167,"url":"https://github.com/edofre/yii2-marker-clusterer","last_synced_at":"2025-04-14T09:21:30.552Z","repository":{"id":56975200,"uuid":"62087919","full_name":"Edofre/yii2-marker-clusterer","owner":"Edofre","description":"Yii2 Maker Clusterer for 2amigos/yii2-google-maps-library","archived":false,"fork":false,"pushed_at":"2017-02-13T15:18:53.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T22:42:50.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Edofre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE.MD","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-27T21:01:05.000Z","updated_at":"2017-02-05T15:29:30.000Z","dependencies_parsed_at":"2022-08-21T11:50:18.570Z","dependency_job_id":null,"html_url":"https://github.com/Edofre/yii2-marker-clusterer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Fyii2-marker-clusterer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Fyii2-marker-clusterer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Fyii2-marker-clusterer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edofre%2Fyii2-marker-clusterer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edofre","download_url":"https://codeload.github.com/Edofre/yii2-marker-clusterer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852189,"owners_count":21171843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T03:28:10.535Z","updated_at":"2025-04-14T09:21:30.521Z","avatar_url":"https://github.com/Edofre.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii2 marker-clusterer widget\n\n[![Latest Stable Version](https://poser.pugx.org/edofre/yii2-marker-clusterer/v/stable)](https://packagist.org/packages/edofre/yii2-marker-clusterer)\n[![Total Downloads](https://poser.pugx.org/edofre/yii2-marker-clusterer/downloads)](https://packagist.org/packages/edofre/yii2-marker-clusterer)\n[![Latest Unstable Version](https://poser.pugx.org/edofre/yii2-marker-clusterer/v/unstable)](https://packagist.org/packages/edofre/yii2-marker-clusterer)\n[![License](https://poser.pugx.org/edofre/yii2-marker-clusterer/license)](https://packagist.org/packages/edofre/yii2-marker-clusterer)\n[![composer.lock](https://poser.pugx.org/edofre/yii2-marker-clusterer/composerlock)](https://packagist.org/packages/edofre/yii2-marker-clusterer)\n\n## Installation\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nTo install, either run\n\n```\n$ php composer.phar require edofre/yii2-marker-clusterer\n```\n\nor add\n\n```\n\"edofre/yii2-marker-clusterer\": \"v1.0.1\"\n```\n\nto the ```require``` section of your `composer.json` file.\n\n## Usage \n\nMarkerClusterer extension to be used in co-operation with [2amigos/yii2-google-maps-library](https://github.com/2amigos/yii2-google-maps-library)\n\nBelow you will find a full example of a view file that uses the clusterer\n```php\n\u003c?php\n\n/* @var $this yii\\web\\View */\n\nuse dosamigos\\google\\maps\\LatLng;\nuse dosamigos\\google\\maps\\overlays\\InfoWindow;\n\n// edofre objects instead of dosamigos\nuse edofre\\markerclusterer\\Map;\nuse edofre\\markerclusterer\\Marker;\n\n$this-\u003etitle = 'Maps Clusterer';\n?\u003e\n\u003cdiv class=\"maps-index\"\u003e\n\t\u003c?php\n\t$map = new Map([\n\t\t'center' =\u003e new LatLng(['lat' =\u003e 52.1326, 'lng' =\u003e 5.2913]), // Center of Netherlands\n\t\t'zoom'   =\u003e 7,\n\t]);\n\n\t$cities = [\n\t\t'Utrecht'    =\u003e new LatLng(['lat' =\u003e 52.0841659, 'lng' =\u003e 5.0124518]),\n\t\t'Groningen'  =\u003e new LatLng(['lat' =\u003e 53.2216845, 'lng' =\u003e 6.4947123]),\n\t\t'Amsterdam'  =\u003e new LatLng(['lat' =\u003e 52.3745291, 'lng' =\u003e 4.7585311]),\n\t\t'Amstelveen' =\u003e new LatLng(['lat' =\u003e 52.2861961, 'lng' =\u003e 4.7820703]),\n\t\t'Hilversum'  =\u003e new LatLng(['lat' =\u003e 52.2315507, 'lng' =\u003e 5.0905084]),\n\t\t'Ede'        =\u003e new LatLng(['lat' =\u003e 52.052436, 'lng' =\u003e 5.6301072]),\n\t\t'Amersfoort' =\u003e new LatLng(['lat' =\u003e 52.1589302, 'lng' =\u003e 5.3077834]),\n\t\t'Zwolle'     =\u003e new LatLng(['lat' =\u003e 52.514148, 'lng' =\u003e 5.9669147]),\n\t\t'Leiden'     =\u003e new LatLng(['lat' =\u003e 52.1517316, 'lng' =\u003e 4.4466504]),\n\t\t'Rotterdam'  =\u003e new LatLng(['lat' =\u003e 51.9279514, 'lng' =\u003e 4.4203666]),\n\t\t'The Hague'  =\u003e new LatLng(['lat' =\u003e 52.0716334, 'lng' =\u003e 4.2398287]),\n\t\t'Delft'      =\u003e new LatLng(['lat' =\u003e 51.9995297, 'lng' =\u003e 4.3286785]),\n\t\t'Eindhoven'  =\u003e new LatLng(['lat' =\u003e 51.4455368, 'lng' =\u003e 5.3814706]),\n\t];\n\n\tforeach ($cities as $city =\u003e $lat_lng) {\n\t\t$marker = new Marker([\n\t\t\t'position'  =\u003e $lat_lng,\n\t\t\t'title'     =\u003e $city,\n\t\t\t'clickable' =\u003e true,\n\t\t]);\n\n\t\t$marker-\u003eattachInfoWindow(new InfoWindow(['content' =\u003e \"\u003cstrong\u003e{$city}\u003c/strong\u003e\"]));\n\t\t$map-\u003eaddOverlay($marker);\n\t}\n\n\t$map-\u003ecenter = $map-\u003egetMarkersCenterCoordinates();\n\t$map-\u003ezoom = $map-\u003egetMarkersFittingZoom() - 1;\n\t?\u003e\n\n\t\u003cdiv class=\"row\"\u003e\n\t\t\u003cdiv class=\"col-sm-12\"\u003e\n\t\t\t\u003c?= $map-\u003edisplay(); ?\u003e\n\t\t\u003c/div\u003e\n\t\u003c/div\u003e\n\u003c/div\u003e\n\n```\n\n\nMake sure to add the google maps key to your assetManager\n\n```php\n'assetManager' =\u003e [\n\t'bundles' =\u003e [\n\t\t'dosamigos\\google\\maps\\MapAsset' =\u003e [\n\t\t\t'options' =\u003e [\n\t\t\t\t'key'      =\u003e 'XYZ',\n\t\t\t\t'language' =\u003e 'nl',\n\t\t\t\t'version'  =\u003e '3.1.18',\n\t\t\t],\n\t\t],\n\t],\n],\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedofre%2Fyii2-marker-clusterer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedofre%2Fyii2-marker-clusterer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedofre%2Fyii2-marker-clusterer/lists"}