maptalks / examples Goto Github PK
View Code? Open in Web Editor NEWmaptalks examples
Home Page: http://maptalks.github.io/examples/en/map/load/
License: MIT License
maptalks examples
Home Page: http://maptalks.github.io/examples/en/map/load/
License: MIT License
change from
https://unpkg.com/maptalks/dist/maptalks.js
to
https://maptalks.org/api/maptalks.min.js
代码语法高亮的载入速度较慢, 需要优化
点击编辑后转到codepen页面后,所有的资源都会出现无法访问的路径问题
instead of jsfiddle
<script type="text/javascript" src="{{ site.baseurl }}/js/tooltips.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/js/classlist.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/js/lang_switch.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/js/sidebar.js"></script>
可以把这四个js合并在一起, 没必要分这么多, 会影响页面载入速度
目前载入第一个基本的页面,也要请求约20M的文件,需要减少文件体积
已经有好几个人问过怎么实现虚线, 有必要单独做个示例
请问如何获取maptalks创建的容器中的内容加载完成的状态值
as the title
5.18 端点沿线自动旋转Marker 这个demo不管用
In v0.37.0, attribution is moved to layer instead of map.
We need to pre-define an attribution config in gulpfile, along with urlTemplate and subdomains
from @deyihu
@ZHEN 图层交互模块:
1.动态修改图层的配置,minZoom maxZoom,features(这个已经有好多同学问了吧)等属性(layer.config())
2.highlight操作,目前例子的还是太简单了,highlight在业务里应该是用的非常多的功能了(就是类geometry的事件交互和动态更新样式),例子里要体现出:
(1)条件的动态过滤性,filter可以简单的值,可以是函数
(2)symbol的多个值的表现行为:color ,opacity,bloom,visible等,里面具体可以配置哪些值我也不知道,你们根据需要在列子的体现
2.图层的identify操作,根据identify的数据动态设置改元素的样式(比如颜色的改变),即用户选中那条数据就高亮那条数据(identify+highlight),参考:
https://maptalks.org/examples/en/interaction/mouse-identify/#interaction_mouse-identify ,甚至可以加个infowindow,将idenfity出来的数据显示出来
修改建议
1.目前renderPlugin里,当用户配置的dataSource和type不匹配,或者不合法要给予提示,警告或者错误,目前是一点反应没有,一片白,用户根本发现不了自己配置错了,所有要明确告诉用户错在哪里,最后做个style validate函数,每个用户更新setStyle时进行style合法性验证
2.style的更新,包括dataSouce,SceneCongfi,symbol等不要用索引,用名字,即每个style item都有一个唯一的名字,举例:
style: [{
name:'building',
filter: ["all", ["==", "$layer", "building"],
["==", "$type", "Polygon"]
],
renderPlugin: {
dataConfig: {
type: "fill",
},
type: "fill",
},
symbol: {
polygonFill: "#2e7e57",
polygonOpacity: 1,
},
}, ],
vt.updateSymbol('building', {
polygonFill: "#f85635",
});
这个问题我给你说过,用索以这个方法太差了,如果对style item做任何的删,添加,排序等,立马GG
代码实现层面优先名字查找,找不到再用索引查询,如果都查不到就提示用户没有查找对应的style item
把html/css/js合并显示, 而不再分开, 点击copy后, 即复制整个html页面内容
类似mapbox-gl-js的示例:
https://www.mapbox.com/mapbox-gl-js/examples/
因css不是example的主要内容
将css中的空格去掉, 把每个css class定义缩减为一行
例如将
html,
body {
margin: 0px;
height: 100%;
width: 100%;
}
#map {
width: 100%;
height: 100%;
}
改为:
html, body { margin: 0px; height: 100%; width: 100%;}
#map { width: 100%; height: 100%; }
模板在这里
https://github.com/maptalks/maptalks.org
clone后, 运行gulp, dist目录下的demo.html即是
as title
use custom tile image example instead of cssfilter
@wsw0108 除了urlTemplate和subdomains, 还需要加上attribution信息
再增加一个图层遮罩示例, 利用区县边界数据剪裁地图底图
add header menu entry same as https://maptalks.org/
.
add a link to other languages.
这是一个常见的需求, 原始infowindow满足不了需求时, 会经常需要定制
for keyword searching, like the examples of THREE
点击打开后的页面,只是一个js被编译后的页面,无法看到完整的源代码
example中目前只把jquery用于en/中文按钮的toggleclass, 这个可以改为vanilla javascript来实现
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.