@MarkBaird Thanks for your response.
I removed WMTS layer. The above snippet seems to be working. But, my hosted LINE feature layer is not visible yet, even though it is loaded. I could not figure out what could have gone wrong with feature layer. Is there anything I need to check?
The layer json looks like this:
Display Field: trackid
Type: Feature Layer
Geometry Type: esriGeometryPolyline
Description:
Definition Expression: N/A
Copyright Text:
Default Visibility: true
MaxRecordCount: 4000
Supported Query Formats: JSON, AMF, geoJSON
Min Scale: 0
Max Scale: 0
Supports Advanced Queries: true
Supports Statistics: true
Use Standardized Queries: true
Supports ValidateSQL: true
Supports Calculate: true
Extent:
XMin: NaN
YMin: NaN
XMax: NaN
YMax: NaN
Spatial Reference: 4326 (4326)
Drawing Info:
Renderer:
Simple Renderer:
Symbol:
Style: esriSLSSolid
Color: [135, 70, 31, 255]
Width: 1 Label: N/A
Description: N/A Transparency: 0
Labeling Info:
Advanced Query Capabilities:
Supports Statistics: true
Supports OrderBy: true
Supports Distinct: true
Supports Pagination: true
Supports TrueCurve: true
Supports Returning Query Extent: true
Supports Query With Distance: true
Supports Sql Expression: true
Supports Query With ResultType: true
Supports Returning Geometry Centroid: false
HasZ: true
HasM: false
Time Info:
Start Time Field: currenttime
End Time Field: null
Track ID Field: null
Time Extent: N/A
Time Reference:
Time Zone: India Standard Time
Respects Daylight Saving: false
Time Interval: 10
Time Interval Units: esriTimeUnitsUnknown
Has Live Data: true
Export Options:
Use Time: true
Time Data Cumulative: false
Time Offset: null (null)
Has Attachments: false
HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText
Type ID Field: