前端任意修改地图风格颜色

在做地图相关应用时,常常遇到地图风格与UI界面不搭配的问题,如果在制图时就制作多种风格的地图,耗时耗力,超出成本控制。这里推荐一种快捷的方法,可在前端快速更改地图成任意风格,使色调与UI搭配。
先上一张图,白色风格地图快速改成蓝调地图的效果。
在这里插入图片描述
整体流程参照了该博客
https://segmentfault.com/a/1190000041703873
简洁说一下流程。

1.svg标签复制

把该网站html里的svg标签全部复制到自己地图网站的body标签里。
https://codepen.io/stoumann/pen/MWeNmyb

2.地图截图上传并调色

截图自己的地图(需要调整风格的地图),上传到该网站进行CSS调色。
https://codepen.io/stoumann/pen/MWeNmyb
在该网站可点击预置的风格,不满意可通过滑块微调。(也可基于预置风格深入调整,不过预置风格一般来说足够用了。)
调整完成后的参数在网站的CSS code栏目里面。

3.把调色结果CSS样式赋给地图div

复制上述网站里的CSS code内容(CSS code里的url已自动关联了svg,不用关注),赋给地图div的style。

4.注意事项

地图里的 marker 等图标div颜色也会被改变,为了让这些图标保持原样,可以给这些图标加上如下CSS样式filter: ;

5.小试牛刀

以下是个人小试牛刀的结果。
原始白底地图为
https://iclient.supermap.io/dev/examples/leaflet/editor.html#01_tiledMapLayer3857
在这里插入图片描述

以下为变成蓝底地图的代码,直接把代码粘在源码窗口运行即可。
在这里插入图片描述

<!--********************************************************************
* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html><head><meta charset="UTF-8" /><title data-i18n="resources.title_tiledMapLayer3857"></title><script type="text/javascript" src="../js/include-web.js"></script><style>#map{filter: brightness(1.3) invert(0.17) saturate(2.6) sepia(0.25) url('#x-rays') contrast(1.3);}</style></head><body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0"><svg id="svgfilters" aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter id="teal-white" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.03 1"/><feFuncG type="table" tableValues="0.57 1"/><feFuncB type="table" tableValues="0.49 1"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="teal-lightgreen" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.03 0.8"/><feFuncG type="table" tableValues="0.57 1"/><feFuncB type="table" tableValues="0.49 0.53"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="sepia" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.26 0.95"/><feFuncG type="table" tableValues="0.19 0.78"/><feFuncB type="table" tableValues="0.11 0.59"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="purple-sepia" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.43 0.97"/><feFuncG type="table" tableValues="0.06 0.88"/><feFuncB type="table" tableValues="0.37 0.79"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="cherry-icecream" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.84 1"/><feFuncG type="table" tableValues="0.05 0.94"/><feFuncB type="table" tableValues="0.37 0.61"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="blackCurrant-and-mint" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.75 0.53"/><feFuncG type="table" tableValues="0.25 0.97"/><feFuncB type="table" tableValues="0.64 0.77"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="sea" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.02 0.13 0.8"/><feFuncG type="table" tableValues="0.02 0.47 0.97"/><feFuncB type="table" tableValues="0.26 0.52 0.48"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="warm-sea" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.29 0.01 0.97"/><feFuncG type="table" tableValues="0.12 0.52 0.94"/><feFuncB type="table" tableValues="0.37 0.59 0.47"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="spring-grass" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0 0.38 0.92"/><feFuncG type="table" tableValues="0.5 0.8 1"/><feFuncB type="table" tableValues="0.5 0.56 0.74"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="red-sunset-with-purple" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.52 0.86 0.97"/><feFuncG type="table" tableValues="0 0.08 0.81"/><feFuncB type="table" tableValues="0.51 0.24 0.05"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="red-sunset" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.27 0.86 0.97"/><feFuncG type="table" tableValues="0.01 0.08 0.81"/><feFuncB type="table" tableValues="0.02 0.24 0.05"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="gold-sunset" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.27 0.86 1"/><feFuncG type="table" tableValues="0.01 0.31 0.95"/><feFuncB type="table" tableValues="0.02 0.02 0.02"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="dark-crimson-sepia" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.01 0.52 0.97"/><feFuncG type="table" tableValues="0 0.05 0.81"/><feFuncB type="table" tableValues="0.02 0.29 0.61"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="dark-blue-sepia" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.29 0.15 0.97"/><feFuncG type="table" tableValues="0.04 0.39 0.93"/><feFuncB type="table" tableValues="0.32 0.52 0.73"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="dark-green-sepia" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.25 0.39 0.96"/><feFuncG type="table" tableValues="0.16 0.52 0.97"/><feFuncB type="table" tableValues="0.06 0.39 0.78"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="x-rays" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.98 0.3 0.25"/><feFuncG type="table" tableValues="1 0.44 0.24"/><feFuncB type="table" tableValues="0.91 0.62 0.39"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="warm-x-rays" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.98 0.75 0.51"/><feFuncG type="table" tableValues="1 0.45 0.11"/><feFuncB type="table" tableValues="0.91 0.39 0.29"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="golden-x-rays" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.98 1 0.94"/><feFuncG type="table" tableValues="1 0.98 0.44"/><feFuncB type="table" tableValues="0.91 0.43 0.02"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="purple-warm" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.52 0.97 1"/><feFuncG type="table" tableValues="0 0.62 1"/><feFuncB type="table" tableValues="0.51 0.39 0.89"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="green-pink-acid" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="1 0.98 0.1"/><feFuncG type="table" tableValues="0.17 1 0.82"/><feFuncB type="table" tableValues="0.7 0.84 0.67"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="yellow-blue-acid" x="-10%" y="-10%" width="120%" height="120%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feColorMatrix type="matrix" values=".33 .33 .33 0 0.33 .33 .33 0 0.33 .33 .33 0 00 0 0 1 0" in="SourceGraphic" result="colormatrix"/><feComponentTransfer in="colormatrix" result="componentTransfer"><feFuncR type="table" tableValues="0.01 0.97 0.89"/><feFuncG type="table" tableValues="0.38 1 1"/><feFuncB type="table" tableValues="1 0.89 0.01"/><feFuncA type="table" tableValues="0 1"/></feComponentTransfer><feBlend mode="normal" in="componentTransfer" in2="SourceGraphic" result="blend"/></filter><filter id="noise" x="0%" y="0%" width="100%" height="100%"><feTurbulence baseFrequency="0.01 0.4" result="NOISE" numOctaves="2" /><feDisplacementMap in="SourceGraphic" in2="NOISE" scale="20" xChannelSelector="R" yChannelSelector="R"></feDisplacementMap></filter><filter id="squiggly-0"><feTurbulence id="turbulence1" baseFrequency="0.02" numOctaves="3" result="noise" seed="0" /><feDisplacementMap id="displacement" in="SourceGraphic" in2="noise" scale="6" /></filter><filter id="squiggly-1"><feTurbulence id="turbulence2" baseFrequency="0.02" numOctaves="3" result="noise" seed="1" /><feDisplacementMap in="SourceGraphic" in2="noise" scale="8" /></filter><filter id="squiggly-2"><feTurbulence id="turbulence3" baseFrequency="0.02" numOctaves="3" result="noise" seed="2" /><feDisplacementMap in="SourceGraphic" in2="noise" scale="6" /></filter><filter id="squiggly-3"><feTurbulence id="turbulence4" baseFrequency="0.02" numOctaves="3" result="noise" seed="3" /><feDisplacementMap in="SourceGraphic" in2="noise" scale="8" /></filter><filter id="squiggly-4"><feTurbulence id="turbulence5" baseFrequency="0.02" numOctaves="3" result="noise" seed="4" /><feDisplacementMap in="SourceGraphic" in2="noise" scale="6" /></filter><filter id="posterize"><feComponentTransfer><feFuncR type="discrete" tableValues="0 .5 1" /></feComponentTransfer></filter><filter id="dancing" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB"><feMorphology operator="dilate" radius="4 4" in="SourceAlpha" result="morphology"/><feFlood flood-color="#30597E" flood-opacity="1" result="flood"/><feComposite in="flood" in2="morphology" operator="in" result="composite"/><feComposite in="composite" in2="SourceAlpha" operator="out" result="composite1"/><feTurbulence type="fractalNoise" baseFrequency="0.01 0.02" numOctaves="1" seed="0" stitchTiles="stitch" result="turbulence"/><feDisplacementMap in="composite1" in2="turbulence" scale="17" xChannelSelector="A" yChannelSelector="A" result="displacementMap"/><feMerge result="merge"><feMergeNode in="SourceGraphic"/><feMergeNode in="displacementMap"/></feMerge></filter><filter id="drops" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feTurbulence type="turbulence" baseFrequency="0.05 0.05" numOctaves="1" seed="3" stitchTiles="stitch" result="turbulence"/><feComposite in="turbulence" in2="SourceGraphic" operator="in" result="composite"/><feColorMatrix type="matrix" values="1 0 0 0 00 1 0 0 00 0 1 0 00 0 0 25 -2" in="composite" result="colormatrix"/><feComposite in="SourceGraphic" in2="colormatrix" operator="in" result="composite1"/><feGaussianBlur stdDeviation="3 3" in="composite1" result="blur"/><feSpecularLighting surfaceScale="2" specularConstant="1" specularExponent="20" lighting-color="#fffffd" in="blur" result="specularLighting"><feDistantLight azimuth="-90" elevation="150"/></feSpecularLighting><feSpecularLighting surfaceScale="2" specularConstant="1" specularExponent="20" lighting-color="#cae1fe" in="blur" result="specularLighting1"><feDistantLight azimuth="90" elevation="150"/></feSpecularLighting><feSpecularLighting surfaceScale="7" specularConstant="1" specularExponent="35" lighting-color="#fcfeff" in="blur" result="specularLighting2"><fePointLight x="150" y="50" z="300"/></feSpecularLighting><feComposite in="specularLighting" in2="composite1" operator="in" result="composite2"/><feComposite in="specularLighting2" in2="composite1" operator="in" result="composite3"/><feComposite in="specularLighting1" in2="composite1" operator="in" result="composite4"/><feBlend mode="multiply" in="composite4" in2="SourceGraphic" result="blend"/><feBlend in="composite2" in2="blend" result="blend1"/><feBlend in="composite3" in2="blend1" result="blend2"/></filter><filter id="grain"><feTurbulence baseFrequency="0.60,0.90" result="colorNoise" /><feColorMatrix in="colorNoise" type="matrix" values=".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 1 0"/><feComposite operator="in" in2="SourceGraphic" result="monoNoise"/><feBlend in="SourceGraphic" in2="monoNoise" mode="multiply" /></filter><filter id="fluffy" x="0%" y="0%" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.04" result="fluffyNoise" numOctaves="5" /><feColorMatrix in="fluffyNoise" type="matrix" values=".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 1 0"/><feComposite operator="in" in2="SourceGraphic" result="monoFluffyNoise"/><feBlend in="SourceGraphic" in2="monoFluffyNoise" mode="screen" /></filter></defs></svg><div id="map" style="margin: 0 auto; width: 100%; height: 100%"></div><script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script><script type="text/javascript">var host = window.isLocal ? window.server : 'https://iserver.supermap.io';var map,url = host + '/iserver/services/map-china400/rest/maps/China';// 方式一:1.调用 L.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图L.supermap.initMap(url);/*// 方式二:1.调用 L.supermap.MapService,获取 SuperMap iServer 地图服务的地图信息//         2.调用 L.supermap.crsFromMapJSON 创建 CRS//         3.调用 L.map 创建地图//         4.调用 L.supermap.TiledMapLayer 创建底图new L.supermap.MapService(url).getMapInfo().then((res) => {var crs = L.supermap.crsFromMapJSON(res.result);map = L.map('map', {crs: crs,center: [0, 0],maxZoom: 18,zoom: 1});new L.supermap.TiledMapLayer(url).addTo(map);});*/</script></body>
</html>

天地图风格更改

可以采用上面3个步骤的方法。也可以采用该方法
https://www.cnblogs.com/naycy/p/16742451.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/146143.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

【sql注入】如何通过SQL注入getshell?如何通过SQL注入读取文件或者数据库数据?一篇文章告诉你过程和原理。sql注入【二】

前言 本篇博客主要是通过piakchu靶场来讲解如何通过SQL注入漏洞来写入文件&#xff0c;读取文件。通过SQL输入来注入木马来getshell等&#xff0c;讲解了比较详细的过程&#xff1b; 如果想要学习SQL注入原理以及如何进行SQL注入&#xff0c;我也写了一篇详细的SQL注入方法及…

Apache Flume

Flume 1.9.0 Developer Guide【Flume 1.9.0开发人员指南】 Introduction【介绍】 摘自&#xff1a;Flume 1.9.0 Developer Guide — Apache Flume Overview【概述】 Apache Flume is a distributed, reliable, and available system for efficiently collecting, aggregati…

编程每日一练(多语言实现)基础篇:求总数问题

文章目录 一、实例描述二、技术要点三、代码实现3.1 C 语言实现3.2 Python 语言实现3.3 Java 语言实现3.4 JavaScript 语言实现 一、实例描述 集邮爱好者把所有的邮票存放在三个集邮册中&#xff0c;在A册内存放全部的十分之二&#xff0c;在B册内存放不知道是全部的七分之几&…

win11+wsl+git+cmake+x86gcc+armgcc+clangformat+vscode环境安装

一、安装wsl &#xff08;1&#xff09;打开power shell 并运行&#xff1a; Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform &#xff08;2&#xff0…

pytorch第一天(tensor数据和csv数据的预处理)lm老师版

tensor数据&#xff1a; import torch import numpyx torch.arange(12) print(x) print(x.shape) print(x.numel())X x.reshape(3, 4) print(X)zeros torch.zeros((2, 3, 4)) print(zeros)ones torch.ones((2,3,4)) print(ones)randon torch.randn(3,4) print(randon)a …

基于Java的汽车票网上预订系统设计与实现(源码+lw+部署文档+讲解等)

文章目录 前言具体实现截图论文参考详细视频演示为什么选择我自己的网站自己的小程序&#xff08;小蔡coding&#xff09;有保障的售后福利 代码参考源码获取 前言 &#x1f497;博主介绍&#xff1a;✌全网粉丝10W,CSDN特邀作者、博客专家、CSDN新星计划导师、全栈领域优质创作…

jenkins+newman+postman持续集成环境搭建

一、Newman简介 Newman是一款基于Node.js开发的&#xff0c;可以运用postman工具直接从命令运行和测试postman集合 二、Newman应用 环境准备&#xff1a;js/ cnpm或npm配置好环境&#xff0c;执行如下命令 三、安装newman 验证是否安装成功&#xff0c;命令&#xff1a;newm…

模块化CSS

1、什么是模块化CSS 模块化CSS是一种将CSS样式表的规则和样式定义封装到模块或组件级别的方法&#xff0c;以便于更好地管理、维护和组织样式代码。这种方法通过将样式与特定的HTML元素或组件相关联&#xff0c;提供了一种更具可维护性、可复用性和隔离性的方式来处理样式。简单…

上机实验一 顺序表的基本操作和简单程序 西安石油大学数据结构

上机一 实验名称&#xff1a;顺序表的基本操作和简单程序 题目&#xff1a;设计一个有序顺序表&#xff0c;实现以下操作&#xff1a; 1.将元素x插入表中并保持有序&#xff1b; 2.查找值为x的元素&#xff0c;若找到则将其删除&#xff1b; 3.输出表中所有元素。 要求&a…

腾讯云 Cloud Studio 实战训练营结营活动获奖公示

点击链接了解详情 “腾讯云 Cloud Studio 实战训练营” 是由腾讯云联合 CSDN 推出的系列开发者技术实践活动&#xff0c;通过技术分享直播、动手实验项目、优秀代码评选、有奖征文活动等&#xff0c;让广大开发者沉浸式体验腾讯云开发者工具 Cloud Studio 的同时&#xff0c;实…

云畅科技TMS解决方案助力华菱线缆实现智能货运管理

9月26日下午&#xff0c;湖南华菱线缆股份有限公司TMS物流系统上线启动会成功举办&#xff0c;由云畅科技倾力打造的华菱线缆TMS物流系统正式上线运行&#xff0c;标志着湖南华菱线缆股份有限公司在智能化物流货运管理领域的一次重大突破。 湖南华菱线缆股份有限公司董事兼总经…

【设计模式】六、建造者模式

文章目录 需求介绍角色应用实例建造者模式在 JDK 的应用和源码分析java.lang.StringBuilder 中的建造者模式 建造者模式的注意事项和细节 需求 需要建房子&#xff1a;这一过程为打桩、砌墙、封顶房子有各种各样的&#xff0c;比如普通房&#xff0c;高楼&#xff0c;别墅&…

【C语言次列车ing】No.1站---C语言入门

文章目录 前言一、什么是C语言二、第一个C语言程序三、数据类型四、变量、常量五、字符串转义字符注释 前言 &#x1f467;个人主页&#xff1a;小沈YO. &#x1f61a;小编介绍&#xff1a;欢迎来到我的乱七八糟小星球&#x1f31d; &#x1f4cb;专栏&#xff1a;C语言次列车i…

【笔试强训day02】倒置字符串 排序子序列

​&#x1f47b;内容专栏&#xff1a; 笔试强训集锦 &#x1f428;本文概括&#xff1a;C笔试强训day02。 &#x1f43c;本文作者&#xff1a; 阿四啊 &#x1f438;发布时间&#xff1a;2023.10.1 二、day02 1.倒置字符串 题目描述&#xff1a; 将一句话的单词进行倒置&…

手动实现BERT

本文重点介绍了如何从零训练一个BERT模型的过程&#xff0c;包括整体上BERT模型架构、数据集如何做预处理、MASK替换策略、训练模型和保存、加载模型和测试等。 一.BERT架构   BERT设计初衷是作为一个通用的backbone&#xff0c;然后在下游接入各种任务&#xff0c;包括翻译…

《MySQL高级篇》十六、主从复制

文章目录 1、主从复制概述1.1 如何提升数据库并发能力1.2 主从复制的作用 2、主从复制的原理2.1 原理剖析2.2 复制的基本原则 3、一主一从架构搭建3.1 准备工作3.2 主机配置文件3.3 从机配置文件3.4 主机&#xff1a;建立账户并授权3.5 从机&#xff1a;配置需要复制的主机3.6 …

面试记录_

1&#xff1a;面试杉岩数据&#xff08;python开发&#xff09; 1.1.1 选择题 for(int i0;i<n;i){for(int j0;j<n;jji) } }O(n) * (O(0) O(n/1) O(n/2) O(n/3) ... O(n/n)) 在最坏情况下&#xff0c;内部循环的迭代次数为 n/1 n/2 n/3 ... n/n&#xff0c;这是…

笔试强训Day8

链接&#xff1a;求最小公倍数__牛客网 T1:求最小公倍数 正整数A和正整数B 的最小公倍数是指 能被A和B整除的最小的正整数值&#xff0c;设计一个算法&#xff0c;求输入A和B的最小公倍数。 数据范围&#xff1a;1≤a,b≤100000 #include<iostream> using namespace…

【算法|贪心算法系列No.2】leetcode2208. 将数组和减半的最少操作次数

个人主页&#xff1a;兜里有颗棉花糖 欢迎 点赞&#x1f44d; 收藏✨ 留言✉ 加关注&#x1f493;本文由 兜里有颗棉花糖 原创 收录于专栏【手撕算法系列专栏】【LeetCode】 &#x1f354;本专栏旨在提高自己算法能力的同时&#xff0c;记录一下自己的学习过程&#xff0c;希望…

Unity把UGUI再World模式下显示到相机最前方

Unity把UGUI再World模式下显示到相机最前方 通过脚本修改Shader 再VR里有时候要把3D的UI显示到相机最前方&#xff0c;加个UI相机会坏事&#xff0c;可以通过修改unity_GUIZTestMode来解决。 测试用例 测试用例如下&#xff1a; 场景包含一个红色的盒子&#xff0c;一个UI…