Giter VIP home page Giter VIP logo

examples's People

Contributors

brucin avatar dependabot[bot] avatar deyihu avatar fuzhenn avatar guzhongren avatar mmjinglin163 avatar wsw0108 avatar yy923683900 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

change url of maptalks.js

change from

https://unpkg.com/maptalks/dist/maptalks.js

to

https://maptalks.org/api/maptalks.min.js

merge javascript files

  <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的文件,需要减少文件体积

vt示例需要改进的建议

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

精简css的内容

因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%; }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.