map-collection-dist icon indicating copy to clipboard operation
map-collection-dist copied to clipboard

Map Collection does not have world map with disputed areas

Open jon-a-nygaard opened this issue 6 years ago • 6 comments

This issue is a continuation of an issue reported in the highcharts/highcharts repository, please see highcharts/highcharts#5061 for full details.

jon-a-nygaard avatar Nov 20 '18 10:11 jon-a-nygaard

Here's a low resolution world map demo: http://jsfiddle.net/BlackLabel/escywjo7/

(Compare with the default: http://jsfiddle.net/gh/get/library/pure/highslide-software/highcharts.com/tree/master/samples/mapdata/custom/world-lowres)

@jon-a-nygaard fyi

KacperMadej avatar Feb 25 '19 12:02 KacperMadej

Medium resolution: http://jsfiddle.net/BlackLabel/mg6Loz8a/

(Default: http://jsfiddle.net/gh/get/library/pure/highslide-software/highcharts.com/tree/master/samples/mapdata/custom/world)

I also have other versions (.geo.json and different details levels maps), but those files are big enough to make a JSFiddle demo almost not responsive (works fine when loaded as a file - as the map should be loaded). If you need any other file please let me know and I'll share it.

Those maps are based on edited sources and are not perfect (shapes of India border), so for a proper fix will probably need a better source.

KacperMadej avatar Feb 25 '19 13:02 KacperMadej

Data labels are not positioned properly in the above demos: image

Workaround:

Import the default map (<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>) and change the name of the custom map: image

Then use the following code to restore original data labels positioning:

Highcharts.maps['custom/world-disputed'].features.forEach(function(featureDisputed) {
	var feature = Highcharts.maps['custom/world'].features.find(function(feature) {
  	return feature.properties.name === featureDisputed.properties.name;
  });
  if(feature) {
  	featureDisputed.properties["hc-middle-x"] = feature.properties["hc-middle-x"];
  	featureDisputed.properties["hc-middle-y"] = feature.properties["hc-middle-y"];
  }
});

Live demo: http://jsfiddle.net/BlackLabel/g1znwd8b/

kamilkulig avatar Jun 28 '19 10:06 kamilkulig

I thought this was going to cover the dispute between China and India, so if you do make this change, please incorporate that as well. Here's an outline, look next to Bhutan. http://4.bp.blogspot.com/-C2YTToI22ME/UCp7e-AQvfI/AAAAAAAABs0/ZO2zw7O1Mb4/s1600/China-Landkarte.gif

ghost avatar Feb 28 '20 05:02 ghost

Data labels are not positioned properly in the above demos: image

Workaround:

Import the default map (<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>) and change the name of the custom map: image

Then use the following code to restore original data labels positioning:

Highcharts.maps['custom/world-disputed'].features.forEach(function(featureDisputed) {
	var feature = Highcharts.maps['custom/world'].features.find(function(feature) {
  	return feature.properties.name === featureDisputed.properties.name;
  });
  if(feature) {
  	featureDisputed.properties["hc-middle-x"] = feature.properties["hc-middle-x"];
  	featureDisputed.properties["hc-middle-y"] = feature.properties["hc-middle-y"];
  }
});

Live demo: http://jsfiddle.net/BlackLabel/g1znwd8b/

@KacperMadej @kamilkulig As this is a custom map, is it allowed to be used in a commercial application with Highcharts license? I'm asking this because I don't see this or any other custom map in the map collection and this particular issue is still in open state.

s-prateek avatar Aug 04 '20 16:08 s-prateek

I apologize for the long reply time.

In short: yes.

In full: For your convenience, Highcharts Maps offers a free collection of maps, optimized for use with Highcharts Maps. This also applies to edited maps available as workarounds.

Copyright information for each map can be found as properties in the GeoJSON and Javascript files. This applies to edited maps available as workarounds.

In general, and doesn't apply in this case, if a source of a new map (or a custom map, or an edited custom map provided as a workaround) adds license-related requirements then such information is provided with the map file or demo.

KacperMadej avatar Dec 24 '20 13:12 KacperMadej