Hello Team,
We are trying to load tile package over a offline raster map but its not visible...
Same thing if we do with on online topographic basemap its properly fitting over world map.
Can you please tells us whats wrong in doing this..
Thank you,
Do you have some code you can share that reproduces the issue?
Yes...Simple below lines of code
void TestRastre::componentComplete()
{
QQuickItem::componentComplete();
// find QML MapView component
m_mapView = findChild<MapQuickView*>("mapView");
m_map = new Map();
// Set map to map view
m_mapView->setMap(m_map);
//girishy Create raster
Raster * raster = new Raster( "INDIA_841.tif");
// girishy create raster layer
RasterLayer *rasterLayer = new RasterLayer(raster);
m_map->basemap()->baseLayers()->append(rasterLayer);
QString datapath="Hyderabad.tpk";
QString name="test";
//girishy Create tiled layer
TileCache * tiledCache = new TileCache(datapath);
// girishy create tiled layer
ArcGISTiledLayer *tiledLayer = new ArcGISTiledLayer(tiledCache);
tiledLayer->setName(name);
m_map->basemap()->baseLayers()->append(tiledLayer);
}
I'd try the below workflow instead. It is preferable to create the Map using one of the constructors other than the default. For example, create it from a Basemap object, which will give it a valid spatial reference. However, you may run into issues if your RasterLayer and TPK are in different spatial references. RasterLayer can project on the fly to a new spatial reference, but TPK cannot
void TestRastre::componentComplete()
{
QQuickItem::componentComplete();
//girishy Create raster
Raster * raster = new Raster( "INDIA_841.tif", this);
// girishy create raster layer
RasterLayer *rasterLayer = new RasterLayer(raster, this);
// find QML MapView component
m_mapView = findChild<MapQuickView*>("mapView");
// Create Map from Basemap
auto basemap = new Basemap(rasterLayer, this);
m_map = new Map(basemap, this);
// Set map to map view
m_mapView->setMap(m_map);
// create TPK
QString datapath="Hyderabad.tpk";
QString name="test";
//girishy Create tiled layer
TileCache * tiledCache = new TileCache(datapath, this);
// girishy create tiled layer
ArcGISTiledLayer *tiledLayer = new ArcGISTiledLayer(tiledCache, this);
tiledLayer->setName(name);
m_map->operationalLayers()->append(tiledLayer);
}
This way also its not working...
Hard to say what the issue is. My best guess would be the spatial references mismatch and the TPK cannot project on-the-fly.
Yes spatial reference mismatch.
Can you please suggest how to enable project on-the-fly for TPK.
TPKs cannot be projected on the fly in ArcGIS Runtime. There are a few options:
1) Re-author your TPK in the proper spatial reference
2) Instead of making your Raster the basemap, set the TPK as your basemap and add the Raster as an operational layer (Rasters CAN project on the fly)
can you please help me brother.i want india.tpk files.this is my mailid:
mannepallimahendra001@gmail.com