Skip to content

没有实例中的LayerSwitch控件 #95

Closed

Description

@David102400

Request a feature or report a bug? [需求]

One-line summary [没有实例中的LayerSwitch控件]

Version [产品及版本]

  • iClient product (for leaflet,for openlayers,for mapboxgl,classic)[openlayers]:
  • iClient version [10]:
  • Browser version 谷歌]:
  • OS Version [win10]:

What is motivation or use case for changing the behavior? [实现图层控制]

Activity

  1. songyumeng commented on Dec 20, 2019

    @songyumeng
    Member

    谢谢您报的issue,不好意思没有明白您的问题。
    下面是关于openlayers的LayerSwitch功能一些插件和demo:
    iClient例子:https://iclient.supermap.io/examples/openlayers/editor.html#controler_layerswitcher
    使用的插件是:https://github.com/walkermatt/ol-layerswitcher

    openlayers关于不内置layer switch的issue:openlayers/openlayers#3622
    openlayers官方例子:https://openlayers.org/en/v4.6.5/examples/layer-group.html

    希望对您有帮助。

  2. David102400 commented on Dec 20, 2019

    @David102400
    Author

    在超图官方示例中的图层控制功能不能在yarn或npm下载的代码中使用。由于超图的4.6.5不是openlayers官方的4.6.5,故无法使用图层控制插件。

  3. songyumeng commented on Dec 20, 2019

    @songyumeng
    Member

    iClient的官网中的范例https://iclient.supermap.io/examples/openlayers/editor.html#controler_layerswitcher
    中使用的layerswitcher是开源插件ol-layerswitcher,并非内部集成功能。
    在yarn和npm中使用请参照该插件的引入方法 (注意ol5版本以下请安装[email protected])。

  4. David102400 commented on Dec 20, 2019

    @David102400
    Author

    是的。问题就在于开源插件ol-layerswitcher是对于yarn [email protected]是可以使用的,但是对于yarn @supermap/iclient-openlayers 中的openlayers4.6.5是无法使用的

  5. songyumeng commented on Dec 20, 2019

    @songyumeng
    Member

    您提到的“超图的4.6.5不是openlayers官方的4.6.5”,这个不知您怎么得出结论的。
    iClient中使用的openlayers 4.6.5 是 openlayers的官方的4.6.5。
    在npm中安装的依赖是
    "dependencies": {
    "openlayers": "4.6.5"
    }。
    在例子中引入的是bootcdn提供的openlayers的cdn地址https://cdn.bootcss.com/openlayers/4.6.5/ol.js
    更换成ol官方的js地址也是没有问题的。
    如果是您再使用中遇到什么问题。请描述一下及提供相关demo,方便我们跟踪并解决问题,谢谢。

  6. songyumeng commented on Dec 20, 2019

    @songyumeng
    Member

    明白您的意思了。
    @supermap/[email protected] 中使用的是[email protected] https://openlayers.org/en/v4.6.5/doc/tutorials/custom-builds.html

    [email protected] 中引用的是[email protected]。

    我们重现下问题,并寻找解决方案。给您带来不便深表歉意。

  7. songyumeng commented on Oct 14, 2020

    @songyumeng
    Member

    @supermap/iclient-ol 最新版本已支持ol5/6及[email protected]以上。欢迎使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions