var map = new esri.Map("map",{logo:false});
<script type="text/javascript"> //Change the background image document.getElementsByClassName('logo-med')[0].style.backgroundImage="url(\"http://www.yoururl.com/to/the/image.gif\")"; //Keep the image from repeating document.getElementsByClassName('logo-med')[0].style.backgroundRepeat="no-repeat"; </script>
If you are trying to replace just the image it can be accomplished by the following code: <script type="text/javascript"> //Change the background image document.getElementsByClassName('logo-med')[0].style.backgroundImage="url(\"http://www.yoururl.com/to/the/image.gif\")"; //Keep the image from repeating document.getElementsByClassName('logo-med')[0].style.backgroundRepeat="no-repeat"; </script>
Thanks, Bailey. I cannot figure out where to insert it in the HTML file, though.
When the user clicks the logo it links to esri.com. How do you disable that, or better yet change the url?
esri.config.defaults.map.logoLink = "http://yoursite.com"
Martin, that is also on Utah's GIS Portal. That is only a portion of what needs to be completed, though, which only adds a custom hyperlink to the logo. I attempted what Utah's site recommends, but it only deleted ESRIs logo, but did not add mine.
I've got both the replacement logo and url working. Make sure you post the (3 lines of) code in your init() function after the map object is created.
Three lines of code? Not sure which code you are using (perhaps a combination of what Bailey and yourself posted)?Is there an additional "dojo.require" statement that may be necessary?
<style type="text/css"> div.map img { position:absolute; bottom:20px; right:20px; z-index:100; width:15px; heigth:15px; } </style> <script type="text/javascript"> function init() { map = new esri.Map("map", { extent: initialExtent, logo: false }); } ... </script> <body class="claro"> ... <div id="map" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="center"> <a href="http://www.google.com"><img src="logo.png" alt="View Logo" /></a> </div> ... </body>
esri.config.defaults.map.logoLink = "http://yoursite.com" document.getElementsByClassName('logo-med')[0].style.backgroundImage="url(\"http://www.yoururl.com/to/the/image.gif\")"; document.getElementsByClassName('logo-med')[0].style.backgroundRepeat="no-repeat";
<style type="text/css"> div.map img { position:absolute; bottom:20px; right:20px; z-index:100; width:15px; heigth:15px; } <body class="nihilo"> </style> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;padding:0;"> <a href="http://www.google.com"><img src="logo.png" alt="View Logo" /></a> <div style="position:absolute; right:20px; top:10px; z-Index:999;"> <div dojoType="dijit.TitlePane" title="Switch Basemap" closable="false" open="false"> <div dojoType="dijit.layout.ContentPane" style="width:380px; height:280px; overflow:auto;"> <div id="basemapGallery" ></div>
I was able to get the example Heming provided to work, except it now affects the format of my "BaseMapGallery" widget because the logo is in the same section (below).<style type="text/css"> div.map img { position:absolute; bottom:20px; right:20px; z-index:100; width:15px; heigth:15px; } <body class="nihilo"> </style> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;padding:0;"> <a href="http://www.google.com"><img src="logo.png" alt="View Logo" /></a> <div style="position:absolute; right:20px; top:10px; z-Index:999;"> <div dojoType="dijit.TitlePane" title="Switch Basemap" closable="false" open="false"> <div dojoType="dijit.layout.ContentPane" style="width:380px; height:280px; overflow:auto;"> <div id="basemapGallery" ></div>
See post# 13. I don't know how else to explain it.
div.map #baseMap { position:absolute; right:20px; top:10px; z-Index:999; } div.map #logo { position:absolute; bottom:20px; right:20px; z-index:100; width:15px; heigth:15px; } Note: #baseMap and #logo are ids of your basemap and your logo image.
.my-logo { display: inline-block; position: absolute; height: 36px; width: 46px; right: 5px; bottom: 5px; z-index: 30; background-image: url('../img/my-logo.png'); cursor: pointer; }
Hi odoe,I'm still a beginner at JavaScript. Can you explain what you mean by "I append a div to the "map_root" element"?
.map .logo-med { display: inline-block; vertical-align: bottom; width: 65px; height: 36px; z-index: 30; background-image: url("../images/map/logo-med.png"); cursor: pointer; _background-image: none; }
<script src="//code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript"> $("#mapDiv_root").append($('<div id ="logo"></div>')); </script>
<style type="text/css"> div.mapDiv_root #logo { display: inline-block; position: absolute; height: 36px; width: 46px; right: 5px; bottom: 5px; z-index: 30; background-image: url('logo.png'); cursor: pointer; } </style>
.logo-med { background-image: url('myLogo.png') !important; height: 50px; width: 100px; }
#mapDiv .logo-med { background-image: url('myLogo.png') !important; height: 50px; width: 100px; }
you should read license agreements here: http://www.esri.com/legal/pdfs/mla_e204_e300/english.pdf4.2 (g) Licensee shall not remove or obscure any Esri or its licensors' patent, copyright, trademark, or proprietary rights notices contained in or affixed to Software, Data, Web Services, or Documentation.
I think this thread should have died right here. Instead, you folks keep discussing how to violate license terms. SMH.4.2 (h) seems to be the appropriate section in the linked version of the agreement. Must have been updated since Erwin posted.
4.1c: Licensee may customize Software using any (i) macro or scripting language, (ii) published application programming interface (API), or (iii) source or object code libraries, but only to the extent that such customization is described in Documentation.
Any way to remove the clickable feature of the logo using the above css example? Or change the url location?
Also my co-worker came back from the UC and said they explained how to change out the logo in one of the seminars.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.