문제

I tried to create a regional map of UK regions, and hoped to use Google charts which I've used reliably before. Unfortunately, as described in this question, Google charts only covers U.S. states and no other regional data. Is there a different way to create such a map?

도움이 되었습니까?

해결책

You can have UK regions map made with amMap:

HTML:

<script src="http://www.ammap.com/lib/3/ammap.js" type="text/javascript"></script>
<script src="http://www.ammap.com/lib/3/maps/js/unitedKingdomLow.js" type="text/javascript"></script>
<div id="mapdiv" style="width: 100%; height: 370px;"></div>

JavaScript:

var map;

AmCharts.ready(function() {
    map = new AmCharts.AmMap();
    map.pathToImages = "http://www.ammap.com/lib/3/images/";
    map.panEventsEnabled = true; 
    map.balloon.color = "#000000";

    var dataProvider = {
        mapVar: AmCharts.maps.unitedKingdomLow,
        getAreasFromMap: true
    };

    map.dataProvider = dataProvider;

    map.areasSettings = {
        autoZoom: true,
        selectedColor: "#CC0000",
        outlineThickness:2
    };

    map.smallMap = new AmCharts.SmallMap();

    map.write("mapdiv");

});

Disclaimer: I am the author of amMap tool. Fiddle: http://jsfiddle.net/amcharts/PN2m8/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top