I am trying to make my way through some ArcGIS server Javascript API tutorials. My current issue is that when I try to display an Esri.Map, all I see is the "powered by esri" logo in the bottom right. My init is below as is my mapDiv.

function init () {

    map = new esri.Map("mapDiv",{
      basemap: "hybrid",
      center: [-80.94, 33.646],
      zoom: 8

    //Create your query
    var queryTask = new esri.tasks.QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer/0");
    //set the onComplete event handler, in this case, when the query is complete, call initLineID,
    //production code would handle handle the error callback as well
    dojo.connect(queryTask, "onComplete", initLineID);

    //build and execute your query
    var query = new esri.tasks.Query();
    query.outFields = ["field_name"];
    query.text = "all";
    query.returnGeometry = true;


<div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div>

Any reason why this would not be working?


You are not adding a layer to the map which is why you only see the logo and a white map.

Try for example adding the world street map:

    var map = new esri.Map("mapDiv");
    var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");

Here is a simple map js fiddle that you can play with


  • Thank you! How can I maintain the original code I had to start at a predefined lat/lon location and zoom level? I tried leaving that in the call to new esri.Map but it seems to be ignored.
    – George
    Jan 21 '13 at 22:01
  • After looking at this a little more, looks like I should have been more specific in the question. How can I accomplish this by using a basemap rather than a full layer? Here's an esri demo that accomplishes more or less what I'm after: esri.com/getting-started/developers/get-started/javascript
    – George
    Jan 21 '13 at 22:09
  • Appologies, you need to be clear on which version of the API you are trying to use too. Version 3.3 was just released this week and I haven't looked at it. Seems there are some changes to the map object. Fiddle updated to use version 3.3 and set the extent. jsfiddle.net/dave_wilton/mSQHp Jan 22 '13 at 7:37
  • So in answer to your original question why does the basemap not show, perhaps it is that you are not using the latest version of the API? Jan 22 '13 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.