function __construct()
{
parent::__construct();
$this->load->model('user');//sql querys to store data
if(!$this->session->userdata('aId') && $this->router->class != 'Login')
{
redirect('Login/index');
}else if($this->session->userdata('aId') && $this->router->class =='Login' && $this->router->method!='shutdown')
{
redirect('user/index');
}
}
答案 0 :(得分:1)
问题出在key_on='feature.properties.name'
应为key_on='feature.properties.DISTRICT'
查看JSON文件,查看纬度/经度坐标所映射到的位置。 在世界地图示例中,在其JSON文件中为“名称”,而在旧金山为“ DISCTRICT”
# download countries geojson file
!wget --quiet https://cocl.us/sanfran_geojson -O san_francisco_nh.json
print('GeoJSON file downloaded!')
sf_geo = r'san_francisco_nh.json'
sanfran_map.choropleth(
geo_data=sf_geo,
data=nh_countindex,
columns=['Neighborhood','Count'],
key_on='feature.properties.DISTRICT',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name="Neighborhood Crime"
)
sanfran_map