java百度地图api轨迹功能源码

java百度地图api轨迹功能源码

<%@ page language="java"
 import="java.util.*,java.text.SimpleDateFormat,com.teletek.soo8web.common.vo.*,com.teletek.soo8web.common.util.*"
 pageEncoding="GBK"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme() + "://"
 + request.getServerName() + ":" + request.getServerPort()
 + path + "/";
%>

<jsp:include page="/common/header.jsp" flush="true">
<jsp:param value="4" name="menu"/>
</jsp:include> 
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>


<script type="text/javascript" src="<%=path%>/js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/My97DatePicker/calendar.js"></script>
<script type="text/javascript" src="<%=path%>/My97DatePicker/config.js"></script>

<script type="text/javascript"
            src="http://api.map.baidu.com/api?v=1.4"></script>
<script type="text/javascript"> 
  
  var marker = null;
        var timerId = null;
        var counter = 0;
        var maplet = null; 
        function initMap() {        
            var map = new BMap.Map("allmap");
   map.centerAndZoom(new BMap.Point(116.404, 39.915), 15);
   map.addControl(new BMap.NavigationControl());  //添加默认缩放平移控件   
   map.enableScrollWheelZoom();
   map.enableContinuousZoom();

    <% List searchList = (List)request.getAttribute("searchList");
                 if(searchList !=null && !searchList.isEmpty()){
                  PositionVo positionVo = null;%>
             var polyline = new BMap.Polyline( 
                [
                <%for(int i = 0; i < searchList.size(); i++){         
                 positionVo = (PositionVo)searchList.get(i); if(i < searchList.size() -1){%>
                  new BMap.Point(<%=positionVo.getLongitude()%>,<%=positionVo.getLatitude()%>),
                  
                 <%}else{%>
                 new BMap.Point(<%=positionVo.getLongitude()%>,<%=positionVo.getLatitude()%>)
                 <%}%>
              
                <%}%>
                ],
                {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5}
         

  • 发表于 2017-11-24 15:00
  • 阅读 ( 1155 )
  • 分类:Java

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
不写代码的码农
江南烟雨

可以跨境界的java开发攻城狮

33 篇文章

作家榜 »

  1. 威猛的小站长 119 文章
  2. Jonny 65 文章
  3. 江南烟雨 33 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 20 文章
  8. Alan 14 文章