Skip to content

Commit

Permalink
fix: geo panel issue
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Aug 26, 2024
1 parent 977f90e commit d505e02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) =
const item = geoList[selectItem];
if (!item) {
vizStore.clearGeographicData();
vizStore.updateGeoKey(featureId);
} else {
vizStore.setVisualLayout('geoUrl', {
type: item.type,
Expand Down Expand Up @@ -141,6 +142,11 @@ const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) =
<DropdownSelect options={options} selectedKey={`${selectItem}`} onSelect={setSelectItem} />
</div>
)}
{!isCustom && selectItem >= 0 && (
<div className={`relative justify-center flex w-full h-80 rounded border shadow-sm`}>
<GeojsonRenderer type={geoList[selectItem].type} url={geoList[selectItem]} />
</div>
)}
{isCustom && (
<div className="my-2">
<label className="block text-xs font-medium leading-6">{t(`geography_settings.${dataMode.toLowerCase()}`)}</label>
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!import.meta.env.DEV) {

embedGraphicWalker(document.getElementById('root') as HTMLElement, {
geoList: [
{ name: 'World Countries', type: 'TopoJSON', url: 'https://cdn.jsdelivr.net/npm/world-atlas@2/countries-10m.json' },
{ name: 'World Countries', type: 'TopoJSON', url: 'https://raw.githubusercontent.com/openlayers/openlayers/main/examples/data/topojson/world-110m.json' },
{
name: 'World Cities',
type: 'GeoJSON',
Expand Down

0 comments on commit d505e02

Please sign in to comment.