Commit 8b84b93d authored by Raph El's avatar Raph El
Browse files

AJout du module map et de l'objet map

parent aaf7e92a
* CO Tools Module
* @author Tibor Katelbach <>
* @version 0.1
class MapModule extends CWebModule {
private $_assetsUrl;
private $_version = "v0.1.0";
private $_versionDate = "07/01/2018";
private $_keywords = "Map, Maperability, module,opensource,CO,communecter";
private $_description = "Un module pour Mapérer avec divers base de données";
private $_pageTitle = "Map";
public function getVersion(){return $this->_version;}
public function getVersionDate(){return $this->_versionDate;}
public function getKeywords(){return $this->_keywords;}
public function getDescription(){return $this->_description;}
public function getPageTitle(){return $this->_pageTitle;}
public function getAssetsUrl()
if ($this->_assetsUrl === null)
$this->_assetsUrl = Yii::app()->getAssetManager()->publish(
Yii::getPathOfAlias($this->id.'.assets') );
return $this->_assetsUrl;
public function getParentAssetsUrl()
return ( @Yii::app()->params["module"]["parent"] ) ? Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() : $this->module->assetsUrl;
public function beforeControllerAction($controller, $action)
if (parent::beforeControllerAction($controller, $action))
// this method is called before any module controller action is performed
// you may place customized code here
return true;
return false;
public function init()
// this method is called when the module is being created
// you may place code here to customize the module or the application
Yii::app()->homeUrl = Yii::app()->createUrl($this->id);
//Apply theme
$themeName = $this->getTheme();
Yii::app()->theme = $themeName;
if(@Yii::app()->request->cookies['lang'] && !empty(Yii::app()->request->cookies['lang']->value))
Yii::app()->language = (string)Yii::app()->request->cookies['lang'];
Yii::app()->language = (isset(Yii::app()->session["lang"])) ? Yii::app()->session["lang"] : 'fr';
Yii::app()->params["module"] = array(
"name" => self::getPageTitle(),
"parent" => "co2",
"overwriteList" => array(
"views" => array(),
"assets" => array(),
"controllers" => array(),
* Retourne le theme d'affichage de communecter.
* Si option "theme" dans paramsConfig.php :
* Si aucune option n'est précisée, le thème par défaut est "ph-dori"
* Si option 'tpl' fixée dans l'URL avec la valeur "iframesig" => le theme devient iframesig
* Si option "network" fixée dans l'URL : theme est à network et la valeur du parametres fixe les filtres d'affichage
* @return type
public function getTheme() {
//$theme = "CO2";
$theme = (@Yii::app()->session["theme"]) ? Yii::app()->session["theme"] : "CO2";
//$theme = "notragora";
if (!empty(Yii::app()->params['theme'])) {
$theme = Yii::app()->params['theme'];
} else if (empty(Yii::app()->theme)) {
$theme = (@Yii::app()->session["theme"]) ? Yii::app()->session["theme"] : "CO2";
//$theme = "CO2";
//$theme = "notragora";
Yii::app()->session["theme"] = $theme;
return $theme;
Leaflet.markercluster @ 232e93cc
Subproject commit 232e93ccbe5b70241913f47a4d1a8ceec8c88c30
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
# mstest test results
sudo: false
language: node_js
- 6
- "travis_phantomjs"
- "export PHANTOMJS_VERSION=2.1.1"
- "hash -r"
- "phantomjs --version"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "hash -r"
- "phantomjs --version"
- "if [ $(phantomjs --version) != \"$PHANTOMJS_VERSION\" ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "hash -r"
- "if [ $(phantomjs --version) != \"$PHANTOMJS_VERSION\" ]; then wget$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != \"$PHANTOMJS_VERSION\" ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "hash -r"
- "phantomjs --version"
\ No newline at end of file
(all changes without author notice are by [@danzel](
## 1.4.1 (2018-09-14)
### Bugfixes
* Better support stopping dragged markers from being clustered (by [@DerGuteWolf]( [#909](
## 1.4.0 (2018-08-22)
Required leaflet version bumped to 1.3.1
### Improvements
* Tests run against leaflet 1.1.0+ [#863](
### Bugfixes
* Fix clearLayers not removing removed markers [#860](
* Remember opacity 0 correctly (by [@r-yanyo]( [#890](
* Fix chunkedLoading LatLngBounds.intersects() (by [@boldtrn]( [#743]( [#891](
## 1.3.0 (2018-01-19)
### Improvements
* Use Rollup for builds (by [@IvanSanchez]( [#769](
### Bugfixes
* Fix Spiderfier positioning for small markers (by [@ghybs]( [#846](
* Fix anchor usage with latest leaflet version [#861](
## 1.2.0 (2017-11-06)
### Improvements
* Move `clusterPane` option in to `options` field (by [@ghybs]( [#832](
### Bugfixes
* Fix very small `maxClusterRadius` hanging the browser (by [@lucaswerkmeister]( [#838](
## 1.1.0 (2017-08-27)
### Improvements
* Add `clusterPane` option to allow putting clusters in a different pane (by [@ckrahe]( [#819](
## 1.0.6 (2017-06-19)
### Bugfixes
* Fix some issues when used with non-integer zoom [#789](
* Change examples to use https (by [@ghybs]( [#794](
## 1.0.5 (2017-04-26)
### Improvements
* Allow passing fitBounds options to zoomToBounds (by [@timkelty]( [#779](
### Bugfixes
* Fixed bug where disableClusteringAtZoom being 0 is treated the same as null (by [@MrCheeze]( [#773](
## 1.0.4 (2017-03-14)
### Bugfixes
* Fix errors removing a MarkerClusterGroup from the map during an animation [#758](
## 1.0.3 (2017-02-02)
### Bugfixes
* Fix moving markers while the MarkerClusterGroup is not on the map [#753](
## 1.0.2 (2017-01-27)
### Improvements
* Support `layeradd` and `layerremove` events [#647](
### Bugfixes
* Add support for maps with negative minZoom [#704](
* Fixed zoomToShowLayer() markers disappearing bug (by [@z3ut]( [#739](
* Fix an issue when opening a popup inside of zoomToShowLayer
* If a marker is moved with an open popup on it, re-open the popup after moving it. [#651](
## 1.0.1 (2017-01-25)
### Improvements
* Add install and build steps with jake (by [@kazes]( [#733](
* Readme improvements (by [@ghybs](, [@bertyhell]( [#734](, [#734](
* Bump all examples to leaflet 1.0.3
### Bugfixes
* Fixed leaflet 1.0.2 bug where clearLayers would throw an exception (by [@marcianoviereck92]( [#746](
## 1.0.0 (2016-10-03)
### Improvements
* Compatibility with Leaflet 1.0.0 (by [@danzel](, [@Eschon](, [@ghybs](, [@IvanSanchez](
* Support moving markers [#57](
* chunkedLoading option to keep browser more responsive during larging a load data set [#292](
* maxClusterRadius can be a function (by [@Schwanksta]( [#298](
* Spiderfy without zooming when all markers at same location (by [@rdenniston](, [@ghybs]( [#415](, [#606](
* On becoming visible, markers retain their original opacity. (by [@IvanSanchez]( [#444](
* Spiderleg Polyline options (by [@mikeatlas]( [#466](
* Extra methods to allow refreshing cluster icons (by [@ghybs]( [#564](
* Ability to disable animations (by [@ghybs]( [#578](
* Optimized performance of bulk addLayers and removeLayers (by [@ghybs]( [#584](
* Replaced spiderfy legs animation from SMIL to CSS transition (by [@ghybs]( [#585](
* Provide more detailed context information on the spiderfied event (by [@evanvosberg]( [#421](
* Add unspiderfied event
* Readme updates (by [@ghybs](, [@tomchadwin]( [@Cyrille37]( [@franckl]( [@mikeatlas](
[@rdenniston]( [@maackle]( [@fureigh]( [@Wildhoney]( [@Schwanksta]( [@frankrowe](
* Improve adding and removing nested LayerGroups (by [@ghybs]( [#624](
* Add public unspiderfy method (by [@zverev]( [#617](
* Optimized performance of bulk add with complex icon create function (by [@mlazowik]( [#697](
* Remove leaflet from peerDependencies (by [@tyleralves]( [#703](
* Simplified _recursively (by [@ghybs]( [#656](
### Bugfixes
* Fix getBounds when removeOutsideVisibleBounds: false is set. [#321](
* Fix zoomToShowLayer fails after initial spiderfy [#286](
* Fix cluster not disappearing on Android [#344](
* Fix RemoveLayers() when spiderified (by [@Grsmto]( [#358](
* Remove lines from map when removing cluster (by [@olive380]( [#532](
* Fix getConvexHull when all markers are located at same latitude (by [@olive380]( [#533](
* Fix removeLayers when cluster is not on the map (by [@eschon]( [#556](
* Improved zoomToShowLayer with callback check (by [@ghybs]( [#572](
* Improved reliability of RefreshSpec test suite for PhantomJS (by [@ghybs]( [#577](
* Corrected effect of removeOutsideVisibleBounds option (by [@ghybs]( [#575](
* Fix getLayer when provided a string [#531](
* Documentation improvements (by [@ghybs]( [#579](
* Correct _getExpandedVisibleBounds for Max Latitude (by [@ghybs]( [#587](
* Correct unspiderfy vector (by [@ghybs]( [#604](
* Remove "leaflet-cluster-anim" class on map remove while spiderfied (by [@ghybs]( [#607](
* Fix disableClusteringAtZoom maxZoom troubles (by [@OriginalSin]( [#609](
* Fix clusters not disappearing when they were near the edge on mobile (by [@ghybs]( [#529](
* Remove leaflet from dependencies (by [@ghybs]( [#639](
* Fix interaction between zoomOrSpiderfy and disableClusteringAtZoom (by [@ghybs]( [#633]( [#648](
## 0.4 (2013-12-19)
### Improvements
* Fix Quick Zoom in/out causing everything to disappear in Firefox (Reported by [@paulovieira]( [#140](
* Slow the expand/contract animation down from 200ms to 300ms
### Bugfixes
* Fix some cases zoomToShowLayer wouldn't work (Reported by [@absemetov]( [#203]( [#228]( [#286](
## 0.3 (2013-12-18)
### Improvements
* Work better with custom projections (by [@andersarstrand]( [#74](
* Add custom getBounds that works (Reported by [@2803media](
* Allow spacing spiderfied icons further apart (Reported by [@stevevance]( [#100](
* Add custom eachLayer that works (Reported by [@cilogi]( [#102](
* Add an option (removeOutsideVisibleBounds) to prevent removing clusters that are outside of the visible bounds (by [@wildhoney]( [#103](
* Add getBounds method to cluster (Reported by [@nderambure]( [#88](
* Lots of unit tests
* Support having Circle / CircleMarker as child markers
* Add factory methods (Reported by [@mourner]( [#21](
* Add getVisibleParent method to allow getting the visible parent cluster or the marker if it is visible. (By [@littleiffel]( [#102](
* Allow adding non-clusterable things to a MarkerClusterGroup, we don't cluster them. (Reported by [@benbalter]( [#195](
* removeLayer supports taking a FeatureGroup (Reported by [@pabloalcaraz]( [#236](
* DistanceGrid tests, QuickHull tests and improvements (By [@tmcw]( [#247]( [#248]( [#249](
* Implemented getLayers (Reported by [@metajungle]( [#222](
* zoomToBounds now only zooms in as far as it needs to to get all of the markers on screen if this is less zoom than zooming to the actual bounds would be (Reported by [@adamyonk]( [#185](
* Keyboard accessibility improvements (By [@Zombienaute]( [#273](
* IE Specific css in the default styles is no longer a separate file (By [@frankrowe]( [#280](
* Improve usability with small maps (Reported by [@JSCSJSCS]( [#144](
* Implement FeatureGroup.getLayer (Reported by [@newmanw]( [#244](
### Bugfixes
* Fix singleMarkerMode when you aren't on the map (by [@duncanparkes]( [#77](
* Fix clearLayers when you aren't on the map (by [@duncanparkes]( [#79](
* IE10 Bug fix (Reported by [@theLundquist]( [#86](
* Fixes for hasLayer after removing a layer (Reported by [@cvisto]( [#44](
* Fix clearLayers not unsetting __parent of the markers, preventing them from being re-added. (Reported by [@apuntovanini]( [#99](
* Fix map.removeLayer(markerClusterGroup) not working (Reported by [@Driklyn]( [#108](
* Fix map.addLayers not updating cluster icons (Reported by [@Driklyn]( [#114](
* Fix spiderfied clusters breaking if a marker is added to them (Reported by [@Driklyn]( [#114](
* Don't show coverage for spiderfied clusters as it will be wrong. (Reported by [@ajbeaven]( [#95](
* Improve zoom in/out immediately making all everything disappear, still issues in Firefox [#140](
* Fix animation not stopping with only one marker. (Reported by [@Driklyn]( [#146](
* Various fixes for new leaflet (Reported by [@PeterAronZentai]( [#159](
* Fix clearLayers when we are spiderfying (Reported by [@skullbooks]( [#162](
* Fix removing layers in certain situations (Reported by [@bpavot]( [#160](
* Support calling hasLayer with null (by [@l0c0luke]( [#170](
* Lots of fixes for removing a MarkerClusterGroup from the map (Reported by [@annetdeboer]( [#200](
* Throw error when being added to a map with no maxZoom.
* Fixes for markers not appearing after a big zoom (Reported by [@arnoldbird]( [#216]( (Reported by [@mathilde-pellerin]( [#260](
* Fix coverage polygon not being removed when a MarkerClusterGroup is removed (Reported by [@ZeusTheTrueGod]( [#245](
* Fix getVisibleParent when no parent is visible (Reported by [@ajbeaven]( [#265](
* Fix spiderfied markers not hiding on a big zoom (Reported by [@Vaesive]( [#268](
* Fix clusters not hiding on a big zoom (Reported by [@versusvoid]( [#281](
* Don't fire multiple clustermouseover/off events due to child divs in the cluster marker (Reported by [@heidemn]( [#252](
## 0.2 (2012-10-11)
### Improvements
* Add addLayers/removeLayers bulk add and remove functions that perform better than the individual methods
* Allow customising the polygon generated for showing the area a cluster covers (by [@yohanboniface]( [#68](
* Add zoomToShowLayer method to zoom down to a marker then call a callback once it is visible
* Add animateAddingMarkers to allow disabling animations caused when adding/removing markers
* Add hasLayer
* Pass the L.MarkerCluster to iconCreateFunction to give more flexibility deciding the icon
* Make addLayers support geojson layers
* Allow disabling clustering at a given zoom level
* Allow styling markers that are added like they were clusters of size 1
### Bugfixes
* Support when leaflet is configured to use canvas rather than SVG
* Fix some potential crashes in zoom handlers
* Tidy up when we are removed from the map
## 0.1 (2012-08-16)
Initial Release!
Contributing to Leaflet.MarkerCluster
1. [Reporting Bugs](#reporting-bugs)
2. [Contributing Code](#contributing-code)
3. [Building](#building)
4. [Testing](#testing)
## Reporting Bugs
Before reporting a bug on the project's [issues page](,
first make sure that your issue is caused by Leaflet.MarkerCluster, not your application code
(e.g. passing incorrect arguments to methods, etc.).
Second, search the already reported issues for similar cases,
and if it's already reported, just add any additional details in the comments.
After you've made sure that you've found a new Leaflet.markercluster bug,
here are some tips for creating a helpful report that will make fixing it much easier and quicker:
* Write a **descriptive, specific title**. Bad: *Problem with polylines*. Good: *Doing X in IE9 causes Z*.
* Include **browser, OS and Leaflet version** info in the description.
* Create a **simple test case** that demonstrates the bug (e.g. using [JSFiddle]( or [JS Bin](
* Check whether the bug can be reproduced in **other browsers**.
* Check if the bug occurs in the stable version, master, or both.
* *Bonus tip:* if the bug only appears in the master version but the stable version is fine,
use `git bisect` to find the exact commit that introduced the bug.
If you just want some help with your project,
try asking [on the Leaflet forum](!forum/leaflet-js) instead.
## Contributing Code
### Considerations for Accepting Patches
While we happily accept patches, we're also committed to keeping Leaflet simple, lightweight and blazingly fast.
So bugfixes, performance optimizations and small improvements that don't add a lot of code
are much more likely to get accepted quickly.
Before sending a pull request with a new feature, check if it's been discussed before already
(either on [GitHub issues](
or [Leaflet UserVoice](,
and ask yourself two questions:
1. Are you sure that this new feature is important enough to justify its presence in the Leaflet core?
Or will it look better as a plugin in a separate repository?
2. Is it written in a simple, concise way that doesn't add bulk to the codebase?
If your feature or API improvement did get merged into master,
please consider submitting another pull request with the corresponding [documentation update](#improving-documentation).
## Building
Install the dependencies:
npm install -g jake
npm install
Then to build:
Output will be in the ```dist/``` directory
## Testing
To run unit tests:
jake test
- [ ] I'm reporting a bug, not asking for help
- [ ] I'm sure this is a Leaflet.MarkerCluster code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
- [ ] I've searched through the issues to make sure it's not yet reported
## How to reproduce
- Leaflet version I'm using:
- Leaflet.MarkerCluster version I'm using:
- Browser (with version) I'm using:
- OS/Platform (with version) I'm using:
- step 1
- step 2
## What behaviour I'm expecting and which behaviour I'm seeing
## Minimal example reproducing the issue
- [ ] this example is as simple as possible
- [ ] this example does not rely on any third party code
Using or any other jsfiddle-like site.
Leaflet.markercluster building, testing and linting scripts.
To use, install Node, then run the following commands in the project root:
npm install -g jake
npm install
To check the code for errors and build Leaflet from source, run "jake".
To run the tests, run "jake test".
For a custom build, open build/build.html in the browser and follow the instructions.
var path = require('path');
desc('Check Leaflet.markercluster source for errors with JSHint');
task('lint', function(){
jake.exec('jshint', {
printStdout: true
}, function () {
console.log('\tCheck passed.\n');
desc('Combine Leaflet.markercluster source files');
task('build', ['lint'], function(){
jake.exec('npm run-script rollup', function() { console.log('Rolled up.'); });
desc('Compress bundled files');
task('uglify', ['build'], function(){
jake.exec('npm run-script uglify', function() { console.log('Uglyfied.'); });
desc('Run PhantomJS tests');
task('test', ['lint'], function() {
var karma = require('karma'),
testConfig = {configFile : path.join(__dirname, './spec/karma.conf.js')};
testConfig.browsers = ['PhantomJS'];
function isArgv(optName) {
return process.argv.indexOf(optName) !== -1;
if (isArgv('--chrome')) {
if (isArgv('--safari')) {
if (isArgv('--ff')) {
if (isArgv('--ie')) {
if (isArgv('--cov')) {
testConfig.preprocessors = {
'src/**/*.js': 'coverage'
testConfig.coverageReporter = {
type : 'html',
dir : 'coverage/'
testConfig.reporters = ['coverage'];
console.log('Running tests...');
var server = new karma.Server(testConfig, function(exitCode) {
if (!exitCode) {
console.log('\tTests ran successfully.\n');
} else {
task('default', ['build', 'uglify']);
Copyright 2012 David Leaver
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be