Leaflet countries

Categories

Component ID

2841284

Component name

Leaflet countries

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

487

Component created

Component changed

Component body

Introduction

When dealing with country data its useful to be able to highlight a country or a set of countries on a map. This module provides a field formatter which can display a single country highlighted on a map. It also integrates with Views which allows you to highlight your country based nodes as countries on a map.

The following image is an example of two nodes displayed on a map as highlighted countries using this module.
Drupal View showing countries on a map

About this module

This module provides:

  • A new field type called leaflet_countries which allows a user to select a country
  • Two field formatters for the new field type:
    • A formatter which displays the country on a leaflet map
    • A formatter which displays the three letter country code
  • A Views style plugin to render countries as leaflet features
  • A Views row plugin to render results as country outlines

Installation

Instructions are in the README.md. Composer is strongly recommended for installing the dependencies.

Dependencies

The module depends on the leaflet module and leaflet library to render the maps. There is also a dependency on the leaflet_topojson module which provides TopoJSON integration with the leaflet library. The dependencies are handled by composer when installing.

Usage

Instructions are in the README.md

Recommended modules

3rd party libraries and licensing

https://github.com/mledoze/countries - License

Credit

Thanks to the very useful library https://github.com/mledoze/countries which makes installing this much easier.