Skip to content

Instantly share code, notes, and snippets.

@anilnairxyz
Last active May 9, 2020 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anilnairxyz/2a8befbd08fe7bcb0698ab51f0f410d8 to your computer and use it in GitHub Desktop.
Save anilnairxyz/2a8befbd08fe7bcb0698ab51f0f410d8 to your computer and use it in GitHub Desktop.
JandK - all regions - all occupiers

This map shows the regions of Jammu and Kashmir that are currently occupied by different countries. To get official sanction these regions should be shown as part of Jammu and Kashmir in the map of India.

Copyright © 2017-20, Sandhya Pillai - MIT License

height:560
license:mit

This map shows the regions of Jammu and Kashmir that are currently occupied by different countries. To get official sanction these regions should be shown as part of Jammu and Kashmir in the map of India.

This map has been generated using the state map of India from Natural Earth while the disputed areas of Jammu and Kashmir have been merged from other maps at the same site.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
svg {background-color: #40444d;}
</style>
</head>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>
var width = 640;
var height = 560;
var vis = d3.select("body").append("svg")
.attr("width", width).attr("height", height)
d3.json("ne_10m_admin_0_Kashmir_Parts.json", function(json) {
var subunits = topojson.feature(json, json.objects.ne_10m_admin_0_Kashmir);
scale = 4000;
offset = [300, 280];
center = [76, 35];
console.log(scale)
console.log(offset)
console.log(center)
// new projection
projection = d3.geo.mercator().center(center)
.scale(scale).translate(offset);
// create the path
var path = d3.geo.path().projection(projection);
// add a rectangle to see the bound of the svg
vis.append("rect").attr('width', width).attr('height', height)
.style('stroke', 'white').style('fill', 'none');
vis.selectAll("path").data(subunits.features).enter().append("path")
.attr("d", path)
.attr("class", function(d) { return d.id; })
.style("fill", "#fc9272")
.style("stroke-width", "1.5")
.style("stroke", "white")
});
</script>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment