maps
maps copied to clipboard
ShapeSource doesn't show MultiPolygon
I'm trying to show a MultiPolygon on the map, but unfortunately only Polygons seems to show on the map and not MultiPolygons. My MultiPolygon (validated on http://geojson.io )
{
"type": "MultiPolygon",
"coordinates": [[
[
[30.45235170178155, -1.857566608930443],
[30.45240316446755, -1.8575576673098195],
[30.45250423122522, -1.8575313183046145],
[30.45256605867296, -1.857507372825397],
[30.45259104531259, -1.8575695834850123],
[30.452614834497947, -1.8575994897444013],
[30.452674284105132, -1.8575755442660997],
[30.452739681457814, -1.8575611697962255],
[30.452797974933233, -1.8576712310059773],
[30.45285024250972, -1.8577493738861275],
[30.45284318175159, -1.8577513832590264],
[30.452895533769716, -1.857878196412793],
[30.452943125615157, -1.857987063471598],
[30.452951037077863, -1.858022484275545],
[30.45292173313498, -1.8580313388030272],
[30.453027606777734, -1.8582024075112924],
[30.453075198623175, -1.858312471374619],
[30.452912321485744, -1.8584285714281017],
[30.45280056297957, -1.8584944057485748],
[30.452709005787494, -1.8585087873936024],
[30.45260080011826, -1.8585195839524935],
[30.45250224145686, -1.85854412468771],
[30.452448580593366, -1.858459799297487],
[30.45259006075904, -1.8583736171642988],
[30.452525827622967, -1.8582898798530132],
[30.452421155926057, -1.858167865699177],
[30.452342271267696, -1.8580230104115263],
[30.452339069672025, -1.858017131335657],
[30.452253413513056, -1.8578544323025692],
[30.45216416858452, -1.857607980647514],
[30.4522307526117, -1.8575876238486253],
[30.45235170178155, -1.857566608930443]
]
]]
}
React Native Code :
<MapboxGL.ShapeSource id={`${id}-${index}`} shape={shape}>
<MapboxGL.FillLayer id={`${id}-fill-${index}`} style={styles.fill} />
<MapboxGL.LineLayer id={`${id}-line-${index}`} style={styles.line} />
<MapboxGL.CircleLayer id={`${id}-vertex-${index}`} style={styles.point} />
</MapboxGL.ShapeSource>
Actually multi polygon showed up when zooming in, seems it's render related issue rather than a polygon and MultiPolygon