# -*- coding: utf-8 -*- """ Highmaps Demos Advanced lat/long: http://www.highcharts.com/maps/demo/latlon-advanced """ from highcharts import Highmap from highcharts.highmaps.highmap_helper import jsonp_loader, js_map_loader, geojson_handler, interpolateRGB H = Highmap(height=550) map_url = 'http://code.highcharts.com/mapdata/countries/us/us-all.js' data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=us-capitals.json&callback=?' geojson = js_map_loader(map_url) data = jsonp_loader(data_url) options = { 'title': { 'text': 'Highmaps lat/lon demo' }, 'tooltip': { 'formatter': "function () {\ return this.point.capital + ', ' + this.point.parentState + '<br>Lat: ' + this.point.lat + ' Lon: ' + this.point.lon + '<br>Population: ' + this.point.population;\ }", 'crosshairs': [{ 'zIndex': 5, 'dashStyle': 'dot', 'snap': False, 'color': 'gray' }, { 'zIndex': 5,
'title': { 'text': 'Highmaps from geojson with multiple geometry types' }, 'mapNavigation': { 'enabled': True, 'buttonOptions': { 'verticalAlign': 'bottom' } }, } H.set_dict_options(options) map_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=australia.geo.json&callback=?' geojson = jsonp_loader(map_url) states = geojson_handler(geojson, 'map') rivers = geojson_handler(geojson, 'mapline') cities = geojson_handler(geojson, 'mappoint') specialCityLabels = { 'Melbourne': { 'align': 'right' }, 'Canberra': { 'align': 'right', 'y': -5 }, 'Wollongong': { 'y': 5 }, 'Brisbane': {
'text' : 'Highmaps from geojson with multiple geometry types' }, 'mapNavigation': { 'enabled': True, 'buttonOptions': { 'verticalAlign': 'bottom' } }, } H.set_dict_options(options) map_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=australia.geo.json&callback=?' geojson = jsonp_loader(map_url) states = geojson_handler(geojson, 'map') rivers = geojson_handler(geojson, 'mapline') cities = geojson_handler(geojson, 'mappoint') specialCityLabels = { 'Melbourne': { 'align': 'right' }, 'Canberra': { 'align': 'right', 'y': -5 }, 'Wollongong': { 'y': 5 }, 'Brisbane': {