1. A concise explanation of the problem you're experiencing.
I am having trouble adding a custom image as material to a polygon being loaded in via GeoJsonDataSource.load. I have tried several of the methods shown in the tutorials and demos, but I cannot seem to get it right.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
GeoJson File:
{
"type": "Polygon",
"properties": {
"tileName": "Tile1",
"fileName": "tile1_1.tif",
"prodDesc": "tile1_1",
"volNum": "Vol 1"},
"coordinates": [
[
[-82.25106048583983, 37.780158068579738],
[-82.25106048583983, 37.853886068563355],
[-82.177332485970908, 37.853886068563355],
[-82.177332485970908, 37.780158068579738]
]
]
}
JavaScript:
var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider : Cesium.createTileMapServiceImageryProvider({
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
}),
sceneMode : Cesium.SceneMode.SCENE2D,
baseLayerPicker : false,
geocoder : false
}
var entity = viewer.dataSources.add(Cesium.GeoJsonDataSource.load('http://127.0.0.1:PORT/PATH'));
entity.material = "PATH/TO/IMAGE";
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I have several aerial shots and their corresponding shapfiles (which I converted to geojson files as polygon types) and would like to display these images on the map in their correct positions.
4. The Cesium version you're using, your operating system and browser.
Version: 1.42
OS: Windows 10
Browser: Edge 25