Use JS Baidu map information pop-up window to display echarts Chart in ASP Web development

Source: Internet
Author: User

Prior to the development of Webgis, mainly enterprise-level development, and for the public-level development platform, such as Baidu map, but very few.

Recently, a project on hand, there is an "electronic map" function, because the functional requirements are only information viewing and browsing, so the use of Baidu map, but in the development of a problem, is the information prompt window, to display the line chart, search a large circle there is no such example.

After thinking about it, because the information window is using HTML code, you can indirectly use the iframe to load a page containing the chart data, the final implementation of the function, the following is a preliminary example of the effect, followed by the UI designer to optimize processing.


Geoc.getlocation (Point, Function (RS) {var html = ["<div class= ' infoboxcontent ' ><div class= ' title ' ><s                   Trong> "+ deptname +" </strong></div> "," <table cellpadding= ' 0 ' cellspacing= ' 0 ' > " , "<tr><td width= ' 100px ' > Yesterday total electricity:</td><td>" + Yesterday + "(kwh) </td><td ro wspan= ' 2 ' ><div style= ' text-align:center; ' ></br><a target= ' _self ' href= ' energysavemain.aspx? Unitcode= "+ deptid +" ' > View </a></div></td></tr> "," <tr><td width= ' 10 0px ' > This month total electricity:</td><td> "+ Lastmonth +" (kwh) </td></tr> "," &LT;TR&GT;&LT;TD cols pan= ' 3 ' ><iframe width= ' 490px ' height= ' 200px ' frameborder= ' no ' border= ' 0 ' marginwidth= ' 0 ' marginheight= ' 0 ' scrolling= ' no ' scrolling= ' no ' src= ' charts.aspx '/></td></tr> "" </Table> "," </div> "];               InfoBox = new Bmaplib.infobox (map, Html.join (""), {boxstyle: {width: "500px", Height: "260px"} , Offset:new bmap.size (0, 170)//170 is the function of adjusting the popover up and down distance, Closeiconurl: ". /..     /images/map/close.png ", Enableautopan:true, align:infobox_at_top}); Infobox.open (point);});

here The main idea code is:

<iframe width= ' 490px ' height= ' 200px ' frameborder= ' no ' border= ' 0 ' marginwidth= ' 0 ' marginheight= ' 0 ' scrolling= ' no ' scrolling= ' no ' src= ' charts.aspx '/>

Use JS Baidu map information pop-up window to display echarts Chart in ASP Web development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.