ArcGIS JavaScript自定义徽标

ArcGIS JavaScript Custom Logo

本文关键字:自定义 JavaScript ArcGIS      更新时间:2023-09-26

我正在尝试为ArcGIS地图应用程序插入自定义徽标。该应用程序提供了一种开箱即用的方式来上传一个完全包含在标题中的小徽标。然而,我想插入一个更大的标志,"覆盖"标题。

我能够部分地使用绝对定位和z索引命令将图像放置在页眉前面,从而使其发挥作用。然而,一旦我这样做了,位于标题中心的标题就移到了最左边,右边的分析按钮也消失了。

Web AppBuilder模板下载包含多个html、.js、.json和.css文件。我使用index.html文件来放置徽标。

我在.html文件中插入徽标后,为什么标题移到左边,分析工具按钮从标题中消失了?我应该在另一个文件中插入徽标吗?

谢谢。

index.html文件中的示例代码:

        <!--[if IE 8]>
<link rel="stylesheet" type="text/css"  href="jimu.js/css/jimu-ie.css" />
<![endif]-->
    <style type="text/css">
    img {
        position: absolute;
        left: 0px;
        top: 0px;
        z-index: 3;
        }
    *{box-sizing: border-box;}
        body,html {
          width:100%;
          height:100%;
          margin:0;
          padding:0;
          overflow:hidden;
        }
        #main-loading{
            width: 100%;
            height: 100%;
            background-color: #2E3F60;
            text-align: center;
            overflow: hidden;
        }
        #main-loading #app-loading, #main-loading #ie-note{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
  }
  #main-loading #app-loading{
    width: 100%;
    height: 100px;
  }
  #main-loading .app-name{
    font: 36px arial;
    font-weight: bold;
    position: absolute;
    z-index: 2;
  }
        #main-loading img{
            position: relative;
            display: block;
            margin: auto;
        }
        #main-loading .loading-info{
            font: 14px 'arial';
            margin-top: 50px;
            overflow: hidden;
            position: relative;
        }
        #main-loading .loading-info .loading{
            width: 260px;
            height: 4px;
            border-radius: 2px;
            background-color: #15203B;
            margin: auto;
        }
        #main-loading .loading-info .loading-progress{
            height: 4px;
            border-radius: 2px;
            background-color: #ABB2BF;
        }
        #main-loading #ie-note {
    width: 586px;
    height: 253px;
    background-image: url('images/notes.png');
    padding: 0 30px 40px 30px;
    font-size: 14px;
    color: #596679;
  }
  #ie-note .hint-title{
    height: 40px;
    line-height: 48px;
    text-align: left;
    font-weight: bold;
  }
  #ie-note .hint-img{
    background-image: url('images/hint.png');
    background-position: left;
    padding-left: 40px;
    margin-top: 20px;
    background-repeat: no-repeat;
    height: 30px;
    text-align: left;
    line-height: 30px;
    font-weight: bold;
  }
  #ie-note span{
    display: block;
    line-height: 14px;
  }
        #main-page{
            display: none;
            width: 100%;
            height: 100%;
            position: relative;
        }
        #jimu-layout-manager{
            width: 100%;
            height: 100%;
            position: absolute;
        }
    </style>

这是因为您使用了绝对定位,现在没有什么可以将文本"推"到右侧。只要在标题文本元素上加上正确的边距,就可以开始了。

请参阅:

img {height: 60px;}
span {height: 60px;display: inline-block;}
#p {position:absolute;}
#o {margin-left: 30px;}
<img src="http://www.mariogame.info/images/icon-facebook.png" id="p" /><span>Absolutely positioned</span>
<hr />
<img src="http://www.mariogame.info/images/icon-facebook.png" /><span>Normally positioned</span>
<hr />
<img src="http://www.mariogame.info/images/icon-facebook.png" /><span id="o">Absolutely positioned - text offset</span>