# Canvas: GeoWorld Map with D3 modules

<div align="center"><img src="https://2376845474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz6CmxFRSBqCTeXXdoA%2F-M2O0Kkl3zawJNmL0hcE%2F-M2O0vM4-gwJJsW1e6_E%2FScreenshot%202020-03-14%20at%205.58.46%20PM.png?alt=media&#x26;token=fe8798c4-8cf9-446d-b50e-8eb4e708ae24" alt=""></div>

```
var width = 960;
var height = 500;

var renderer = i2d.canvasLayer('#myCanvas', {}, {});

var projection = d3.geoMercator()
				   .translate([width/2, height/2])
				   .center([-80, 60]);
        
var path = d3.geoPath()
		  	 .projection(projection);

var worldmap = d3.json("./../data/world.geo.json");

Promise.all([worldmap]).then(function(values) {
	let path_ = renderer.createEl({
		el: 'path',
		attr: {
			d: path(values[0])
		},
		style: {
			shadowOffsetX: 3,
			shadowOffsetY: 3,
			shadowColor: '#333333',
			fillStyle: 'rgba(255, 130, 130, 1)'
		}
	})
	.on('mouseover', function() {
		this.setStyle('fillStyle', 'rgba(250, 60, 60, 1)');
	}).on('mouseout', function() {
		this.setStyle('fillStyle', 'rgba(255, 130, 130, 1)');
	});
});
```
