zoukankan      html  css  js  c++  java
  • javascript download geoserver layer as kml file

     var sqlfilter = " CITY='" + city + "' and SDATE>" + sdate + " and SDATE <" + edate;

    soMapRoad.downLoadGeoLayer(actionId, kpi, layerTitle, sqlfilter);
     
     function downloadTileGridMap(layerName, styleId, filterQuery) {

            var url = "http://" + geoIP + "/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&LAYERS=FAST:" + layerName + "&STYLES=" + styleId + "&CQL_FILTER=" + filterQuery + "&bbox=109.0,20.0,118.0,26.0&width=768&height=512&srs=EPSG:4326&format=application/vnd.google-earth.kml+xml";
                     
            window.open(url);
        }


        function downLoadGeoLayer(currentActionId, kpi, sqlfilter) {

            $.getJSON("../Action.json",
                function (json) {
                    $.each(json,
                        function (infoIndex, info) {

                            var actionId = info["ID"];

                            if (actionId === currentActionId) {
                                var layerName = info["layers"];
                                var styleId = info["style"];
                                var bbox = info['filter'];
                                var filter = sqlfilter;
                                downloadTileGridMap(layerName, styleId, filter, bbox);
                            }
                        });
                });
        }
  • 相关阅读:
    java 二维码图片生成工具类
    我的PHP学习过程
    js简单表格操作
    在同一个textarea文本框中设置不同的字体
    基础入门--创建项目
    异常处理方式
    2019年度的瞎几把总结
    WebAPI 返回值
    关于背景色
    使用echarts进行画图
  • 原文地址:https://www.cnblogs.com/googlegis/p/11764947.html
Copyright © 2011-2022 走看看