Select to view content in your preferred language

Cached layer won't display.

2551
4
Jump to solution
07-10-2012 10:41 PM
TimCollyer
Regular Contributor
I have created two tiled map service caches on the same machine under the same parent virtual directory.

Ultimately I want to add them both to the same map using the javascript API (code below), however one works and the other doesn't.

I do get an image for the one that doesn't work when using the default rest interface export map so I presume the service is working and the cache is not corrupt.

If I inspect my requests/responses in my browser, the one that does work sends a request that looks something like this:

http://<url that works>/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback


And then a bunch of requests that look like this for the individual tiles:

http://<url that works>/MapServer/tile/7/19331/8249


However when I inspect the requests sent to the service that doesn't work, I only see that first request and even though it gets a response code 200 (it actually gets a 304 response if I'm sending the request over the same extent again, but both services exhibit this behavior), no future requests are sent for the individual tiles.

There are no javascript errors getting reported in the console.

I have rebuilt the cache many times, cleared the rest server cache, restarted iis, etc.

var map, network;        function init() {     var initialExtent = new esri.geometry.Extent({   "xmin":467086.5986925309,"ymin":6902883.906684718,"xmax":470864.85624904605,"ymax":6904045.429841098,"spatialReference":{"wkid":28356}     });         map = new esri.Map("map", {  extent: initialExtent,  logo: false     });          dojo.connect(map, 'onLoad', function(map) {  dojo.connect(dijit.byId('map'), 'resize', map,map.resize);     });       //var url1 = "http://<working url>";     var url1 = "http://<not working url>";       network = new esri.layers.ArcGISTiledMapServiceLayer(url1);     map.addLayer(network);  }
0 Kudos
1 Solution

Accepted Solutions
TimCollyer
Regular Contributor
Ok, I totally just fluked the solution...

Out of desperation, I decided to try version 3.0 of the API. However I was running my existing test from local file system and I had to deploy to my web server to get 3.0 functioning properly and boom... Both cache layers now work.

So I presume it was some kind of same origin policy shenanigans in play (I'm using chrome fwiw)... but I'm a bit disappointed I saw no errors indicating this in the console or network traffic... and I still can't figure out why it would work for one of the layers and not the other...

I guess the lesson is to not do things half assed - even when testing. 😛

View solution in original post

0 Kudos
4 Replies
TommyBramble
Regular Contributor
If you remove the initialExtent property in your map constructor will the <not working> map load then?  Only thing that comes to mind is that the map service that is not loading might have a different spatial reference.

Also, browse the service that is not working through the REST directory browser and select one of the 'View in..' options at the top of the page (i.e. View in ArcGIS JavaScript).  Is the service fully functional?  Can you pan and zoom to all the expected extents and scales?

Hope this helps...good luck.
0 Kudos
JeffPace
MVP Alum
Also try the built in javascript viewer in the rest endpoint and make sure it is working.
0 Kudos
TimCollyer
Regular Contributor
Thanks guys. I totally forgot about the default viewer... Still pretty new. 😛

It looks like the service appears fine when using the default ArcGIS JavaScript viewer from "View in"... It loads and I can pan around fine. At this stage I have only created one level of cache, so I can zoom in, but I obviously get a blank screen - but that's expected.

I'm fairly sure my coordinate systems/spatial references/scale levels/etc are all in sync... For reference this is from the "Additional Info" on the services when viewed in ArcCatalog. The one that works is first.

The only difference is the extent...

Map Service: Optimized
Anti-Aliasing: None
Text Anti-Aliasing: Force
Service Type: Cached (fused)
File Format: PNG8
Restriction: Sub-layers can't be turned on or off
Cache Scales at 96 DPI:
1:200 (1 pixel = 0.052917 m)
1:500 (1 pixel = 0.132292 m)
1:1,000 (1 pixel = 0.264584 m)
1:2,000 (1 pixel = 0.529168 m)
1:5,000 (1 pixel = 1.322919 m)
1:10,000 (1 pixel = 2.645839 m)
1:15,000 (1 pixel = 3.968758 m)
1:20,000 (1 pixel = 5.291677 m)
1:50,000 (1 pixel = 13.229193 m)
1:100,000 (1 pixel = 26.458386 m)
1:200,000 (1 pixel = 52.916773 m)
1:500,000 (1 pixel = 132.291931 m)
1:1,000,000 (1 pixel = 264.583863 m)


Extent:
Top: 8780091.324700 m
Left: -1070947.440900 m
Right 827838.130000 m
Bottom: 6761982.253600 m


Coordinate System:
Name: GDA_1994_MGA_Zone_56
Projection: Transverse_Mercator
False_Easting: 500000.000000
False_Northing: 10000000.000000
Central_Meridian: 153.000000
Scale_Factor: 0.999600
Latitude_Of_Origin: 0.000000
Linear Unit: Meter (1.000000)


Geographic Coordinate System: GCS_GDA_1994
Name: GCS_GDA_1994
Angular Unit: Degree (0.017453292519943299)
Prime Meridian: Greenwich (0.000000000000000000)
Datum: D_GDA_1994
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.000000000000000000
    Semiminor Axis: 6356752.314140356100000000
    Inverse Flattening: 298.257222101000020000




Map Service: Optimized
Anti-Aliasing: None
Text Anti-Aliasing: Force
Service Type: Cached (fused)
File Format: PNG8
Restriction: Sub-layers can't be turned on or off
Cache Scales at 96 DPI:
1:200 (1 pixel = 0.052917 m)
1:500 (1 pixel = 0.132292 m)
1:1,000 (1 pixel = 0.264584 m)
1:2,000 (1 pixel = 0.529168 m)
1:5,000 (1 pixel = 1.322919 m)
1:10,000 (1 pixel = 2.645839 m)
1:15,000 (1 pixel = 3.968758 m)
1:20,000 (1 pixel = 5.291677 m)
1:50,000 (1 pixel = 13.229193 m)
1:100,000 (1 pixel = 26.458386 m)
1:200,000 (1 pixel = 52.916773 m)
1:500,000 (1 pixel = 132.291931 m)
1:1,000,000 (1 pixel = 264.583863 m)


Extent:
Top: 7139267.374200 m
Left: 0.000000 m
Right 6897323.702000 m
Bottom: 542835.789000 m


Coordinate System:
Name: GDA_1994_MGA_Zone_56
Projection: Transverse_Mercator
False_Easting: 500000.000000
False_Northing: 10000000.000000
Central_Meridian: 153.000000
Scale_Factor: 0.999600
Latitude_Of_Origin: 0.000000
Linear Unit: Meter (1.000000)


Geographic Coordinate System: GCS_GDA_1994
Name: GCS_GDA_1994
Angular Unit: Degree (0.017453292519943299)
Prime Meridian: Greenwich (0.000000000000000000)
Datum: D_GDA_1994
  Spheroid: GRS_1980
    Semimajor Axis: 6378137.000000000000000000
    Semiminor Axis: 6356752.314140356100000000
    Inverse Flattening: 298.257222101000020000


0 Kudos
TimCollyer
Regular Contributor
Ok, I totally just fluked the solution...

Out of desperation, I decided to try version 3.0 of the API. However I was running my existing test from local file system and I had to deploy to my web server to get 3.0 functioning properly and boom... Both cache layers now work.

So I presume it was some kind of same origin policy shenanigans in play (I'm using chrome fwiw)... but I'm a bit disappointed I saw no errors indicating this in the console or network traffic... and I still can't figure out why it would work for one of the layers and not the other...

I guess the lesson is to not do things half assed - even when testing. 😛
0 Kudos