效果图:
所要用到的资源文件:
1.topojson.js 下载地址:http://www.oschina.net/p/topojson
2.china.topojson 、southchinasea.svg 以及 places.json 下载地址:http://download.csdn.net/detail/u013147600/8815899
其中places.json 是虚假数据
3. d3.min.js 下载地址:http://d3js.org/ ----(d3.zip)
源码:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>d3-中国地图标注</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style&g