zoukankan      html  css  js  c++  java
  • 小付地图学习

    1.如何初始化地图

    webViewMap={}  

    CBSCache2.version = 1;
    CBSCache2.id = CBSCache2.name;
    CBSCache2.base64 = false;
    webViewMap.map = new XiaoFu.Map("#cbscontent", { bgColor: "white" });  
    webViewMap.baseLayer = new XiaoFu.XiaoFuCacheLayer(CBSCache2);
    webViewMap.map.addLayer(webViewMap.baseLayer);

    2.添加marker层

     var markerLayer = new XiaoFu.MarkerLayers("marker");

     webViewMap.map.addLayer(markerLayer);

    3.添加多个marker

    for(var i=0;i<count;i++){
    var coordinates = data.message.recordSets[0].records[i].geometry.coordinates;
    var x=coordinates[0];
    var y=coordinates[1];

    var demo = $("<img/>")
    .attr("src", "http://images.cnblogs.com/marker.png")
    .css("width", 30)
    .css("height", 30)
    .css("position", "absolute")
    .css("cursor", "pointer")
    .css("border", "0px solid white");
    var markerId = 'marker'+i;
    var marker = new XiaoFu.Marker({id:markerId,x:x,y:y});
    marker.data = demo;
    markerLayer.addChild(marker);
    }

    4.添加infowindow

    infoWindow =new XiaoFu.InfoWindow();

    infoWindow.strHtml="testinfowindow";

    infoWindow.x = 14254888.263400003;

    infoWindow.y = 5161875.567100003;
    webViewMap.map.addLayer(infoWindow);
    infoWindow.show();

    5.添加control

    control = new XiaoFu.Navigation();
    webViewMap.map.addControl(control);
    control.showNavBar();

    6.地图的平移

    var point = new XiaoFu.GeoPoint(x,y);
    webViewMap.map.panTo(point);

       

  • 相关阅读:
    Zookeeper白话解析
    WireMock简单使用
    mysql通用包安装
    修改mysql密码
    jmeter for循环嵌套if学习2
    jmeter for循环嵌套if学习1
    jmeter Transaction Controller学习
    jmeter ForEach Controller学习
    loadrunner随笔1
    shell中创建mysql库和执行sql脚本
  • 原文地址:https://www.cnblogs.com/lilefordream/p/2981264.html
Copyright © 2011-2022 走看看