Select to view content in your preferred language

Getting 304 errors with OverviewMap

2469
16
Jump to solution
12-10-2013 06:24 PM
PattyJula
Deactivated User
Hi, I have a feature layer and scale bar working properly in a web page with the JavaScript API. When I add an Overview Map, I get 304 errors and can only see an info box when I open the page. My code is below.

<!DOCTYPE html> <html>   <head>      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">     <title>LA Collisions</title>     <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css">     <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">      <style>          html, body, map { height: 100%; margin: 0; padding: 0; }           #info {          background: #fff;          box-shadow: 0 0 5px #888;          left: 5em;          padding: 0.5em;          position: absolute;           top: 1em;          z-index: 40;       }     </style>      <script>var dojoConfig = { parseOnLoad: true }</script>     <script src="http://js.arcgis.com/3.7/"></script>     <script>        var map;        require([          "esri/map",          "dijit/layout/BorderContainer",          "dijit/layout/ContentPane",          "esri/dijit/InfoWindowLite",         "esri/InfoTemplate",         "esri/layers/FeatureLayer",         "dojo/dom-construct",         "esri/dijit/OverviewMap",          "esri/dijit/Scalebar",         "dojo/parser",         "dojo/domReady!"        ], function (            Map,           InfoWindowLite,           InfoTemplate,           FeatureLayer,           domConstruct,           OverviewMap,    Scalebar,           parser       ) {         parser.parse();         var  map = new Map("map", {           basemap: "topo",           center: [-118.5, 34],           zoom: 11         });                 var scalebar = new Scalebar({           map: map,           // "dual" displays both miles and kilmometers           // "english" is the default, which displays miles           // use "metric" for kilometers           scalebarUnit: "dual"         });        var infoWindow = new InfoWindowLite(null, domConstruct.create("div", null, null, map.root));         infoWindow.startup();         map.setInfoWindow(infoWindow);          var template = new InfoTemplate();         template.setTitle("<b>${OMEGA_NAME}</b>");         template.setContent("<b>Collision Count:</b> ${COUNT_}</br>  <b>Area (square miles):</b> ${AREA_MI}</br>");          //add a layer to the map         var featureLayer = new FeatureLayer("http://arcgis-pjula1gistusc-772545567.us-west-1.elb.amazonaws.com/arcgis/rest/services/LAPD_collisions2/MapServer/0", {            mode: FeatureLayer.MODE_ONDEMAND,           infoTemplate:template,           outFields: ["OMEGA_NAME","REP_DIS", "COUNT_", "AREA_MI", "COLL_RATE"],           opacity:.60         });          map.addLayer(featureLayer);         });          var overviewMapDijit = new OverviewMap({            map: map,           visible: true         });         overviewMapDijit.startup();       });       </script>   </head>     <body>      <div id="info">         Click on a reporting district in Los Angeles to get more information.       </div>   <body class="claro">       <div data-dojo-type="dijit/layout/BorderContainer"           data-dojo-props="design:'headline', gutters:false"          style="width: 100%; height: 100%; margin: 0;">        <div id="map"             data-dojo-type="dijit/layout/ContentPane"             data-dojo-props="region:'center'"             style="overflow:hidden;">    </body>  </html> 


Does anyone see what I'm missing? I'm using ArcGIS 10.2 and JavaScript 3.7. The feature layer will probably not be visible when you run this code. Thanks! Patty
0 Kudos
16 Replies
JeffPace
MVP Alum
hope you find the error in lining them up.  Thats the easy answer 😉
0 Kudos
PattyJula
Deactivated User
hope you find the error in lining them up.  Thats the easy answer 😉


I did! Thank you so much! I had not added "dojo/dom-style" to my JavaScript. Now that it's added, the hover tool works with my geocoder and base maps. Thanks again for talking that out with me! 😄 Patty
0 Kudos
JeffPace
MVP Alum
Happy to help.  I am willing to be almost every developer (myself included) has made that mistake at least once.

Glad you are on the right track.
0 Kudos
JonathanUihlein
Esri Regular Contributor
Thanks Jeff!
Glad everything was taken care of!
Apologies for the delayed response; most of us have been at the DevSummit all week.
0 Kudos
JeffPace
MVP Alum
sure jon, ill cover for all the developers having fun at the dev conference while I sit here in my cube all week.  🙂
0 Kudos
PattyJula
Deactivated User
Haha, you should try to make it there next year, Jeff! I attended the first few days - it was great!
0 Kudos
JeffPace
MVP Alum
I wish, I have never been.

I do make it to the UC every other year, but County Budgets are very volatile.  Plus our Department has gone from 11 people to 5 and our workload has tripled, so not alot of free time.

What I do have I try to spend on here.  Lots to learn, Lots to share (mostly from mistakes I have made myself at one point in time)
0 Kudos