VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-geonaturalearth2-function/

⇱ D3.js geoNaturalEarth2() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js geoNaturalEarth2() Function

Last Updated : 15 Jul, 2025

The JavaScript D3.js library provides interactive data visualizations for web page using HTML5, Scalable Vector Graphics, and Cascading Style Sheets. The geoNaturalEarth2() function in d3.js is used to draw the Natural Earth II projection which Compared to Natural Earth I is slightly taller and rounder.

Syntax:

d3.geoNaturalEarth2()

Parameters: This method does not accept any parameters.

Return Value: This method creates the Natural Earth  II projection from given JSON data.

Example 1: The following example creates NaturalEarth II projection of world with center at (0, 0) and no rotation.

Output:

👁 Image

Example 2: In following example we will create NaturalEarth2 projection of world with center at (0, 10) and rotating 60 degree with respect to Y axis.

Output:

👁 Image

Comment
Article Tags: