I am using arcgis javascript api in my application and working with a dynamic map service resource exposed by the ArcGIS Server REST API . Hence I am making using of the ArcGISDynamicMapServiceLayer to load.
But after adding the layer of ArcGISDynamicMapServiceLayer to the map, the map is not taking projection of this layer.
So i tried using GeometryService.project by passing the ProjectParameters() and i am trying to set the ArcGISDynamicMapServiceLayer.initialExtent and project toward it.
But i am getting ArcGISDynamicMapServiceLayer.initialExtent as
{
spatialReference: { wkid: 4326}
type: "extent"
xmax: 180
xmin: -180
ymax: 90
ymin: -90
}
on the first load and then after that works fine.
So what is the best way if i just want to load a map and then project towards ArcGISDynamicMapServiceLayer layer on the map?