Download the PHP package iqual/iq_datamaps without Composer

On this page you can find all versions of the php package iqual/iq_datamaps. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package iq_datamaps

iq_datamaps

A basic wrapper for Map Integrations using DataMaps.

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

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

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()

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

Kind: public function

clearSettings()

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

Kind: public function

restoreBaseSettings()

Restores base settings.

Kind: public function

setScope(scope)

Restores base settings.

Kind: public function Param Type Description
scope string 3-digit country code of scope.

initMap(scope) ⇒ DataMaps Object

Prints a map with a given set of custom settings.

Kind: public function Param Type Description
settings Object Custom DataMaps settings.

initMap(scope) ⇒ DataMaps Object

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

Kind: public function Param Type Description
settings Object Custom DataMaps settings.

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':  "<strong>Oh, hi Marc!</strong>",
    '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  '<div class="map-tooltip">' + data.tooltip_content + '</div>';
  },
  highlightFillColor:  'var(--map-color-active)',
  highlightBorderColor:  'var(--map-color-active)',
});

All versions of iq_datamaps with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
drupal/core Version ^9 || ^10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iqual/iq_datamaps contains the following files

Loading the files please wait ....