If you have used Baidu Statistics or cnzz statistics, you should know that there is a map statistics in the background, and the colors of provinces with different visits are different. today, I will lead you to develop such a case. Today, I want to introduce how to load data into maps in practical applications. Combined with examples, this article uses PHP + Mysql + jQuery to achieve the data statistics of each province on map in China.
In this example, the number of active users of a product in each province is counted. The data comes from the mysql database and is divided into different levels based on the number of active users in each province, the activity of each province is displayed with different background colors, meeting the actual application requirements.
HTML
First, load the raphael. js library file and the chinamapPath. js path file in the head section.