PHPackages                             iqual/iq\_datamaps - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iqual/iq\_datamaps

ActiveDrupal-custom-module[Utility &amp; Helpers](/categories/utility)

iqual/iq\_datamaps
==================

DataMaps interface for Drupal

v2.3.0(6mo ago)01.5k↑50%JavaScriptPHP ^8.1

Since Jan 4Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/iqual-ch/iq_datamaps)[ Packagist](https://packagist.org/packages/iqual/iq_datamaps)[ RSS](/packages/iqual-iq-datamaps/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

iq\_datamaps
============

[](#iq_datamaps)

A basic wrapper for Map Integrations using [DataMaps](http://datamaps.github.io/).

Background
----------

[](#background)

Every now and then, we need to implement some sort of map functionality that cannot be achieved using Google maps. DataMaps provides a powerfull, highly customizable framework for any kind of map functionalities. The purpous of this module is to provide a basic wrapper to easily integrate DataMaps into web projects.

Usage
-----

[](#usage)

The modul provides a Drupal library containing all necessary assets:

```
iq_datamaps/datamaps_base

```

It can be attached like any other drupal library. Besided the DataMaps distribution it contains very basic map and tooltip styling and a JS class to interact with DataMaps JS: `iqDataMapsWrapper`.

### The iqDataMapsWrapper Class

[](#the-iqdatamapswrapper-class)

Create a new JS object from the iqDataMapsWrapper class:

```
let mapObject = new iqDataMapsWrapper(element);

```

element: DOM Container element that will hold the map.

The `iqDataMapsWrapper` provides a set of base settings for DataMaps to print a basic world map and the following methods:

clearSettings()
---------------

[](#clearsettings)

Removes all base settings. DataMap's defaults are now applied.

**Kind**: public function

clearSettings()
---------------

[](#clearsettings-1)

Removes all base settings. DataMap's defaults are now applied.

**Kind**: public function

restoreBaseSettings()
---------------------

[](#restorebasesettings)

Restores base settings.

**Kind**: public function

setScope(scope)
---------------

[](#setscopescope)

Restores base settings.

**Kind**: public function

ParamTypeDescriptionscope`string`3-digit country code of scope.initMap(scope) ⇒ `DataMaps Object`
----------------------------------

[](#initmapscope--datamaps-object)

Prints a map with a given set of custom settings.

**Kind**: public function

ParamTypeDescriptionsettings`Object`Custom DataMaps settings.initMap(scope) ⇒ `DataMaps Object`
----------------------------------

[](#initmapscope--datamaps-object-1)

Uses `initMap()` to print a responsive map with a given set of custom settings.

**Kind**: public function

ParamTypeDescriptionsettings`Object`Custom DataMaps settings.Use-cases / examples
--------------------

[](#use-cases--examples)

Print a (responsive) world map:

```
let element = document.getElementById('map-wrapper');
let dataMap = new  iqDataMapsWrapper(element);
dataMap.initResponsiveMap();

```

Highlight countries on world map:

```
let element = document.getElementById('map-wrapper');
let dataMap = new  iqDataMapsWrapper(element);
let highlights = {
  'CHE': {fillKey:  'active'},
}
dataMap.initResponsiveMap({data:  highlights});

```

Print a swiss map

```
let element = document.getElementById('map-wrapper');
let dataMap = new  iqDataMapsWrapper(element);
dataMap.setScope('che');
dataMap.initResponsiveMap({
  setProjection:  function (element) {
    let  scaleFactor = element.offsetWidth * 12.5;
    var  projection = d3.geo.mercator()
      .center([8.2, 46.8182])
      .scale(scaleFactor)
      .translate([element.offsetWidth / 2, element.offsetHeight / 2]);
    var  path = d3.geo.path().projection(projection);
    return { path:  path, projection:  projection };
  }
});

```

Print a swiss map with markers

```
let element = document.getElementById('map-wrapper');
let dataMap = new  iqDataMapsWrapper(element);
let mapMarkers = [
  {
    'radius': 5,
    'latitude': 46.9376,
    'longitude': 7.3950,
    'tooltip_content':  "Oh, hi Marc!",
    'fillKey': 'active'
  }
];
dataMap.setScope('che');
dataMap.initResponsiveMap({
  setProjection:  function (element) {
    let  scaleFactor = element.offsetWidth * 12.5;
    var  projection = d3.geo.mercator()
      .center([8.2, 46.8182])
      .scale(scaleFactor)
      .translate([element.offsetWidth / 2, element.offsetHeight / 2]);
    var  path = d3.geo.path().projection(projection);
    return { path:  path, projection:  projection };
  }
}).bubbles(mapMarkers, {
  popupTemplate:  function (geo, data) {
    return  '' + data.tooltip_content + '';
  },
  highlightFillColor:  'var(--map-color-active)',
  highlightBorderColor:  'var(--map-color-active)',
});

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance66

Regular maintenance activity

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~204 days

Recently: every ~255 days

Total

6

Last Release

208d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/890fffdae387fc892ae3303b453cc41e8da9f56a3ae19463e8d9694478e29ee6?d=identicon)[danielwirz](/maintainers/danielwirz)

![](https://www.gravatar.com/avatar/43082de1b2e2b2b2d48b7ff7dbc7c60ff1d0a015123d4062ac0b49ea0b3b725f?d=identicon)[iqual](/maintainers/iqual)

---

Top Contributors

[![danielwirz](https://avatars.githubusercontent.com/u/42937331?v=4)](https://github.com/danielwirz "danielwirz (6 commits)")[![youpixxl](https://avatars.githubusercontent.com/u/3398689?v=4)](https://github.com/youpixxl "youpixxl (3 commits)")

### Embed Badge

![Health badge](/badges/iqual-iq-datamaps/health.svg)

```
[![Health](https://phpackages.com/badges/iqual-iq-datamaps/health.svg)](https://phpackages.com/packages/iqual-iq-datamaps)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.2k6.7k1](/packages/farmos-farmos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
