1.1.5 • Published 4 years ago

world-map-component v1.1.5

Weekly downloads
52
License
-
Repository
-
Last release
4 years ago

World Map Component

A World Map popup overlay with sorted by continents and countries.

interface

Table of Contents

Installation

npm install world-map-component

Usage

Import component and register the component

import Vue from 'vue';
import WorldMapComponent from 'world-map-component';

export default Vue.extend({
	name: 'ServeDev',
	components: {
		WorldMapComponent,
	},
});
</script>
<template>
	<div id="app">
		<world-map-component />
	</div>
</template>

Component props

Required Props

  • legendItems: This is the legend that you will see on the bottom left corner of this component. LegendItems has to be an Array with objects which only contains the properties color and title
    //example
    [
    	{
    		color: 'orange',
    		title: 'test',
    	},
    	{
    		color: 'blue',
    		title: 'test2',
    	},
    ];
    interface
  • countryItems: The countryItems also has to be an Array with objects that only contains the properties color, name, and shortCode. This property will have affect on the component in 2 areas. First is that this list will be populated on the right side of the component and second it will render the pins on the approriate location on the map. The pins will use the shortCodes to place the pins in the middle of the correct country. To see a list (in json format) of all the shortcodes click here

    //example
    [
    	{
    		color: 'orange',
    		name: 'Netherland',
    		shortCode: 'NL',
    	},
    	{
    		color: 'blue',
    		name: 'Russia EU',
    		shortCode: 'RU-EU',
    	},
    	{
    		color: 'blue',
    		name: 'Russia AS',
    		shortCode: 'RU-AS',
    	},
    ];
    • Countries List:

      interface

    • Pins:

      interface

Optional Props

  • width: You can set the width of the container (default is 1200px)
  • height: You can set the height of the container (default is according the svg)

Run your unit tests

In order to run tests, you need to clone this repo first.

git clone https://github.com/smitnet/world-map-component.git

cd world-map-component

npm run test:unit
1.1.5

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.2

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago