Graphic Overlay Differs between MapPack and TilePack

2333
2
09-01-2011 12:29 PM
Labels (1)
by Anonymous User
Not applicable
Original User: merlich

Trying to add a graphic overlay marker and I get different results when using an mpk and tpk.  It shows correctly with the mpk, but is way off in the ocean when placed on a tpk.  The attached images show the differences.  The same arcmap project was used for creating both.  For the ESRI folks, I used the same data/mpk/tpk that I placed on our ftp for you.

After loading the map layer, here is the code I used to add the graphic overlay:

            PictureMarkerSymbol vehicle = LayoutRoot.Resources["VehicleSymbol"] as ESRI.ArcGIS.Client.Symbols.PictureMarkerSymbol;
            GraphicsLayer imageOverlaysLayer = new GraphicsLayer();
            map.Layers.Add(imageOverlaysLayer);

            Graphic currentVehicleMarker = new Graphic()
            {
                Geometry = new MapPoint(-105.09744, 39.8021),
                Symbol = _vehicle
            };
            imageOverlaysLayer.Graphics.Add(currentVehicleMarker);


Thanks,
Mike
0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: merlich

Figured it out, the spatial reference is set to WGS_1984_Web_Mercator_Auxiliary_Sphere.  Can this be set to normal WGS 1984 for the tile format?

Here is the confusion.  Mpk files keep the WGS 1984 used with the project.  Tpk files create the packs using WGS_1984_Web_Mercator_Auxiliary_Sphere.  We will use several layers on the map consisting of both mpk and tpk files.

If I only use an mpk file and add a symbol, I can set it with a mappoint using the actual lat/lon values.
If I only use a tpk file and add a symbol, I have WebMercator.FromGeographic to translate the lat/lon values so they display in the correct location.

If I load a tpk file, then an mpk file to layer on top, both layers display properly (the mpk appears to be translated to use the web_mercator) and WebMercator.FromGeographic is required to translate the lat/lon of symbols.

If I load the mpk, then layer a tpk on top, the tpk doesn't get displayed at all.

So, is there something I'm overlooking in setting up the layers, or should they use the same projection?  Can the tiling be changed to not use the web_mercator, or should the project be changed to use the web_mercator projection so the mpk also uses the projection?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

So, is there something I'm overlooking in setting up the layers, or should they use the same projection?  Can the tiling be changed to not use the web_mercator, or should the project be changed to use the web_mercator projection so the mpk also uses the projection?


Hi,

Generally the layers (services) in your map control should all use the same coordinate system. Tiled layers, whether ArcGISTiledMapServiceLayer or LocalTileCacheLayer, consist of a full set of prerendered map images and therefore cannot be reprojected on the fly. Dynamic layers/services, by contrast, can be reprojected on the fly by the ArcGIS Runtime and by ArcGIS Server but it's worth remembering that this will be done on a per request basis and therefore will incur some degree of performance overhead.

The tiling scheme used by the Tile Package can be anything you like - if you want to use a WGS84 that's fine. You can create your own, or alternatively for guidance, use the option "An existing map service" then browse to a connection to an existing map service. For example you use the URL "http://services.arcgisonline.com/arcgis/rest/services" to add a map service then browse to the ESRI_Imagery_World_2D which is a service in WGS84 with an appropriate tiling scheme for a global service in that projection. You could then add some additional scales below the 1:4508... scale. Remember - "...Every time you halve the scale's denominator, it takes four times as many tiles to cover a square area of the map..." - for more info see http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Planning_a_ma....

Cheers

Mike
0 Kudos