Skip to content

Commit

Permalink
fix: geo panel issue (#411)
Browse files Browse the repository at this point in the history
* fix: geo panel issue

* fix: geoList in playground

* fix: geoList
  • Loading branch information
islxyqwe authored Aug 26, 2024
1 parent 977f90e commit 436e7bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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: 'GeoJSON', url: 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json' },
{
name: 'World Cities',
type: 'GeoJSON',
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/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: 'GeoJSON', url: 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json' },
{
name: 'World Cities',
type: 'GeoJSON',
Expand Down

0 comments on commit 436e7bf

Please sign in to comment.