8

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.
4
  • 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? Commented Sep 27, 2010 at 21:43
  • He said "no ArcGIS server" - straight Apache only, otherwise, it's dead simple, as you say.
    – Herb
    Commented Sep 27, 2010 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
    Commented Sep 27, 2010 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. Commented Sep 27, 2010 at 22:33

2 Answers 2

8

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.

4
  • 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
    Commented Sep 28, 2010 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
    Commented Sep 28, 2010 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
    Commented Sep 28, 2010 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
    Commented Sep 28, 2010 at 20:44
1

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.

1
  • 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
    Commented Sep 28, 2010 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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