<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Scalebar - wrong start unit in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scalebar-wrong-start-unit/m-p/204715#M18976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IÂ´ve got a problem with the scalebar in my map: The Scalebar doesnÂ´t show the right scale when the homepage is opened the first time. After dragging the map or after zooming, the scalebar works right. We use parts of the code from the ESRI-sample (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/widget/widget_scalebar.html" rel="nofollow"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/widget/widget_scalebar.html&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And here is a short part out of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:&amp;quot;Courier New&amp;quot;;"&gt; &amp;lt;script type="text/javascript"&amp;gt;djConfig = { parseOnLoad:true }&amp;lt;/script&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;script type="text/javascript" src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt; dojo.require("dijit.dijit"); // optimize: load dijit layer&lt;BR /&gt; dojo.require("esri.map");&lt;BR /&gt; dojo.require("esri.toolbars.navigation");&lt;BR /&gt; dojo.require("esri.dijit.Scalebar");&lt;BR /&gt; dojo.require("dijit.layout.BorderContainer");&lt;BR /&gt; dojo.require("dijit.layout.ContentPane");&lt;BR /&gt; dojo.require("dijit.layout.AccordionContainer");&lt;BR /&gt; dojo.require("dijit.form.Button");&lt;BR /&gt; dojo.require("dijit.Toolbar");&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; var map, navToolbar;&lt;BR /&gt; function init() {&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; var layersLoaded = 0; //varible to keep track of when all layers have been loaded.&lt;BR /&gt; var loading = dojo.byId("loadingImg"); //loading image. id&lt;BR /&gt; &lt;BR /&gt; esriConfig.defaults.map.sliderLabel = null;&lt;BR /&gt; Eintragung des Start-Extents&lt;BR /&gt; var startExtent = new esri.geometry.Extent&lt;BR /&gt; ({"xmin":3447000.000000,"ymin":5758000.000000,"xmax":3464000.000000,"ymax":5772000.000000,"spatialReference":{"wkid":31467}});&lt;BR /&gt; &lt;BR /&gt; map = new esri.Map("map", {extent:startExtent});&lt;BR /&gt; navToolbar = new esri.toolbars.Navigation(map);&lt;BR /&gt; dojo.connect(map, "onLoad", showLoading);&lt;BR /&gt; dojo.connect(map, "onZoomStart", showLoading);&lt;BR /&gt; dojo.connect(map, "onPanStart", showLoading);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var nr1 = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://nts1p008/ArcGIS/rest/services/Dienste/LP_Halle_Steinhagen/MapServer" rel="nofollow" target="_blank"&gt;http://nts1p008/ArcGIS/rest/services/Dienste/LP_Halle_Steinhagen/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; map.addLayer(nr1);&lt;BR /&gt; dojo.connect(nr1, "onUpdate", hideLoading);&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; var nr2 = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://nts1p008/ArcGIS/rest/services/Dienste/TK50_SW_red/MapServer" rel="nofollow" target="_blank"&gt;http://nts1p008/ArcGIS/rest/services/Dienste/TK50_SW_red/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; map.addLayer(nr2);&lt;BR /&gt; dojo.connect(nr2, "onUpdate", hideLoading);&lt;BR /&gt; &lt;BR /&gt; dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized&lt;BR /&gt; clearTimeout(resizeTimer);&lt;BR /&gt; var resizeTimer = setTimeout(function() {&lt;BR /&gt; map.resize();&lt;BR /&gt; map.reposition();&lt;BR /&gt; }, 500);&lt;BR /&gt; });&lt;BR /&gt; dojo.connect(map, 'onLoad', function(map) {&lt;BR /&gt; var scalebar = new esri.dijit.Scalebar({&lt;BR /&gt; map: map,&lt;BR /&gt; scalebarUnit:'metric'&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt;});&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; function showLoading() {&lt;BR /&gt; esri.show(loading);&lt;BR /&gt; map.hideZoomSlider();&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; function hideLoading() {&lt;BR /&gt; layersLoaded++;&lt;BR /&gt; if (layersLoaded === map.layerIds.length) {&lt;BR /&gt; esri.hide(loading);&lt;BR /&gt; map.showZoomSlider();&lt;BR /&gt; layersLoaded = 0;&lt;BR /&gt; }&lt;BR /&gt; } &lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt; function extentHistoryChangeHandler() {&lt;BR /&gt; dijit.byId("zoomprev").disabled = navToolbar.isFirstExtent();&lt;BR /&gt; dijit.byId("zoomnext").disabled = navToolbar.isLastExtent();&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt; dojo.addOnLoad(init);&lt;BR /&gt;&lt;SPAN&gt; esri.config.defaults.map.logoLink = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.kreis-guetersloh.de" rel="nofollow" target="_blank"&gt;http://www.kreis-guetersloh.de&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe someone have recognized the same problem with the scalebar. Please let me know If you need more code. It would be nice if you can help me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2011 10:36:18 GMT</pubDate>
    <dc:creator>DirkSchaefer</dc:creator>
    <dc:date>2011-03-18T10:36:18Z</dc:date>
    <item>
      <title>Scalebar - wrong start unit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scalebar-wrong-start-unit/m-p/204715#M18976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IÂ´ve got a problem with the scalebar in my map: The Scalebar doesnÂ´t show the right scale when the homepage is opened the first time. After dragging the map or after zooming, the scalebar works right. We use parts of the code from the ESRI-sample (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/widget/widget_scalebar.html" rel="nofollow"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/widget/widget_scalebar.html&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And here is a short part out of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:&amp;quot;Courier New&amp;quot;;"&gt; &amp;lt;script type="text/javascript"&amp;gt;djConfig = { parseOnLoad:true }&amp;lt;/script&amp;gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;script type="text/javascript" src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt; dojo.require("dijit.dijit"); // optimize: load dijit layer&lt;BR /&gt; dojo.require("esri.map");&lt;BR /&gt; dojo.require("esri.toolbars.navigation");&lt;BR /&gt; dojo.require("esri.dijit.Scalebar");&lt;BR /&gt; dojo.require("dijit.layout.BorderContainer");&lt;BR /&gt; dojo.require("dijit.layout.ContentPane");&lt;BR /&gt; dojo.require("dijit.layout.AccordionContainer");&lt;BR /&gt; dojo.require("dijit.form.Button");&lt;BR /&gt; dojo.require("dijit.Toolbar");&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; var map, navToolbar;&lt;BR /&gt; function init() {&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; var layersLoaded = 0; //varible to keep track of when all layers have been loaded.&lt;BR /&gt; var loading = dojo.byId("loadingImg"); //loading image. id&lt;BR /&gt; &lt;BR /&gt; esriConfig.defaults.map.sliderLabel = null;&lt;BR /&gt; Eintragung des Start-Extents&lt;BR /&gt; var startExtent = new esri.geometry.Extent&lt;BR /&gt; ({"xmin":3447000.000000,"ymin":5758000.000000,"xmax":3464000.000000,"ymax":5772000.000000,"spatialReference":{"wkid":31467}});&lt;BR /&gt; &lt;BR /&gt; map = new esri.Map("map", {extent:startExtent});&lt;BR /&gt; navToolbar = new esri.toolbars.Navigation(map);&lt;BR /&gt; dojo.connect(map, "onLoad", showLoading);&lt;BR /&gt; dojo.connect(map, "onZoomStart", showLoading);&lt;BR /&gt; dojo.connect(map, "onPanStart", showLoading);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var nr1 = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://nts1p008/ArcGIS/rest/services/Dienste/LP_Halle_Steinhagen/MapServer" rel="nofollow" target="_blank"&gt;http://nts1p008/ArcGIS/rest/services/Dienste/LP_Halle_Steinhagen/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; map.addLayer(nr1);&lt;BR /&gt; dojo.connect(nr1, "onUpdate", hideLoading);&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; var nr2 = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://nts1p008/ArcGIS/rest/services/Dienste/TK50_SW_red/MapServer" rel="nofollow" target="_blank"&gt;http://nts1p008/ArcGIS/rest/services/Dienste/TK50_SW_red/MapServer&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; map.addLayer(nr2);&lt;BR /&gt; dojo.connect(nr2, "onUpdate", hideLoading);&lt;BR /&gt; &lt;BR /&gt; dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized&lt;BR /&gt; clearTimeout(resizeTimer);&lt;BR /&gt; var resizeTimer = setTimeout(function() {&lt;BR /&gt; map.resize();&lt;BR /&gt; map.reposition();&lt;BR /&gt; }, 500);&lt;BR /&gt; });&lt;BR /&gt; dojo.connect(map, 'onLoad', function(map) {&lt;BR /&gt; var scalebar = new esri.dijit.Scalebar({&lt;BR /&gt; map: map,&lt;BR /&gt; scalebarUnit:'metric'&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt;});&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; function showLoading() {&lt;BR /&gt; esri.show(loading);&lt;BR /&gt; map.hideZoomSlider();&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; function hideLoading() {&lt;BR /&gt; layersLoaded++;&lt;BR /&gt; if (layersLoaded === map.layerIds.length) {&lt;BR /&gt; esri.hide(loading);&lt;BR /&gt; map.showZoomSlider();&lt;BR /&gt; layersLoaded = 0;&lt;BR /&gt; }&lt;BR /&gt; } &lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt; function extentHistoryChangeHandler() {&lt;BR /&gt; dijit.byId("zoomprev").disabled = navToolbar.isFirstExtent();&lt;BR /&gt; dijit.byId("zoomnext").disabled = navToolbar.isLastExtent();&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt; dojo.addOnLoad(init);&lt;BR /&gt;&lt;SPAN&gt; esri.config.defaults.map.logoLink = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.kreis-guetersloh.de" rel="nofollow" target="_blank"&gt;http://www.kreis-guetersloh.de&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe someone have recognized the same problem with the scalebar. Please let me know If you need more code. It would be nice if you can help me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 10:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scalebar-wrong-start-unit/m-p/204715#M18976</guid>
      <dc:creator>DirkSchaefer</dc:creator>
      <dc:date>2011-03-18T10:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scalebar - wrong start unit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scalebar-wrong-start-unit/m-p/204716#M18977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi Dirk&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;did you solve this issue, for me the scalebar indicates big numbers all time and the browser freezes when loading the application. when i remove the scalebar the problem disappear and everything works correctly. Have you any idea about using scalebar for spatialrefence different than web mercator and WGS 84&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:53:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scalebar-wrong-start-unit/m-p/204716#M18977</guid>
      <dc:creator>hcgis</dc:creator>
      <dc:date>2012-12-05T20:53:51Z</dc:date>
    </item>
  </channel>
</rss>

