Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Can I programmatically consume and render custom map tiles in ArcMap via our ArcGIS 10 Desktop AddIn?

The AddIn is built using the ArcObjects SDK for C#/.NET and ArcGIS 10. Pulling and rendering map tiles is NOT the AddIn's primary function. But we would definitely like to implement this feature if it can be done.

More specifics:

  • I received a tip that the ITiledMapServer2 interface is involved but it is unclear to me, and there is a dearth of info in ArcObjects docs regarding this task. The equivalent class within the ArcGIS for Flex API is TiledMapServiceLayer, but again this is an ArcMap AddIn in the desktop space, not a web app.
  • We have in-house software to generate our own tiles in the same zoom, tile Y, tile X tiling scheme akin to the Google maps JS/Flash APIs.
  • We are using Apache to serve the map tiles and thus are currently not using ArcGIS Server in any way (i.e. authoring the tiles, publishing as an ArcGIS Server map service, etc).
  • I've posted the question to SO and received a recommendation to post here.

Thank you in advance.

share|improve this question
    
If all you're trying to do is get at the map tiles on an ArcGIS Server, why not just add the service as a layer in your MXD? –  Michael Todd Sep 27 '10 at 21:43
    
He said "no ArcGIS server" - straight Apache only, otherwise, it's dead simple, as you say. –  Herb Sep 27 '10 at 21:56
    
Thanks Michael. Because the tiles aren't on an ArcGIS Server or in any way served by an ArcGIS Server. These are our custom tiles currently served by a machine running Apache administered by us. Why? We have various web apps using the Google maps API and the ArcGIS API for Flex that consume these tiles. And it would nice to simply piggy-back on this infrastructure within our Desktop AddIn. If serving our tiles as a published map service via ArcGIS Server is the only way to do this, that's fine - just want to know that up front. –  Josh Sep 27 '10 at 21:58
    
(Oops, glossed over your third bullet point.) You could try structuring the images in such a way that you could request the tiles as needed (X/Y directory names, XML lookup, etc.), but you'd essentially be writing your own "image tile server" from scratch. It'd be a lot easier to let a pre-written tool do its job (if you have access to it) than to write it yourself. –  Michael Todd Sep 27 '10 at 22:33
add comment

2 Answers 2

up vote 8 down vote accepted

I think that you're looking at implementing a custom layer. I don't know how else you'd render data inside ArcMap. Outside of a purely academic exercise, I haven't done it. There's a starter page of info available here, with a list of minimal interfaces you'd need to implement. On the plus side, there is a developer sample. The down-side is that you're treading into seriously non-trivial development territory. Fun, but non-trivial.

Or you could look at what the guys on the ArcBruTile codeplex project have done, which looks an awful lot like what you're attempting.

share|improve this answer
    
Yes, custom layers is the way to go. It is not trivial, but not a daunting task either. Since you will be drawing rasters and not vectors, the most difficult part will be drawing the bitmaps in the right place on the Win32 device context. I would also highly recommend some kind of in-memory caching logic. –  Petr Krebs Sep 28 '10 at 9:29
    
@petr_k - Right on the money with caching being critical - the network traffic will kill your performance otherwise. The guys in the referenced codeplex site (claim to) have dealt with this. I haven't looked through their code to see how they're deciding how long to hang on to a tile. –  Herb Sep 28 '10 at 12:41
    
Gentlemen, thank you both. @Herb especially, many thanks for the codeplex link to the ArcBruTile project. It does indeed look like what we're attempting to do. I've scanned the code, the caching appears to be handled by first attempting to load tiles from disk. Not there? Then load over the web then write them to disk. –  Josh Sep 28 '10 at 16:48
    
@Josh - Glad to help - the ArcBruTile project was a fun find for me as well. Would you care to mark the question "answered"? –  Herb Sep 28 '10 at 20:44
add comment

Addins are for basic functionality and customizations like Custom Layers will require a COM solution and can be done by using ArcObjects & .NET. However, this cannot be done using Addins.

share|improve this answer
    
Perhaps, but we're able to accomplish quite a bit at the AddIn level given the ArcObjects API for ArcGIS 10. A demo of our AddIn: youtube.com/watch?v=m2YRrCk3aKI –  Josh Sep 28 '10 at 16:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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