【问题标题】:jQuery and OpenLayers matching themejQuery 和 OpenLayers 匹配主题
【发布时间】:2012-07-07 22:10:39
【问题描述】:

背景

在同一网页上使用 jQuery 小部件和 OpenLayers 小部件。

问题

jQuery 有Theme Roller,而 OpenLayers 有它的default theme。这导致:

工具包控件有不同的颜色。这可以通过自定义OpenLayersjQuery 以匹配另一个来解决,但如果可能的话,我宁愿不重新发明轮子。例如:

问题

我在哪里可以找到 OpenLayers 2.12jQuery UI 1.8.18(免费提供)的主题,它们的配色方案一致?

谢谢!

【问题讨论】:

    标签: css jquery-ui themes openlayers


    【解决方案1】:
    1. 跳过向地图对象添加常用/默认控件
    2. 创建 DIV 图层,该图层的样式设置为 zIndex ~ 4000 高于任何地图对象 + 绝对位置固定在屏幕上
    3. 在该层上创建控制 jQuery 按钮
    4. 捕捉这些按钮的点击事件并通过其 Map 对象适当地控制地图

    看例子,有一个 jQueryMobile 例子,它使用了 jQueryMobile 按钮,所以同样的任务。

    【讨论】:

      【解决方案2】:
      /**
       * Colour customizations for jQuery and OpenLayers widgets.
       */
      .ui-dialog-titlebar, div.olControlZoom a {
        background: #0065bd !important;
      }
      

      您可以使用 FireDebug(或同等工具)来检查 UI 元素。从那里,使用 CSS 更改 UI 元素的颜色。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-11-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-27
        • 1970-01-01
        相关资源
        最近更新 更多