Skip to content

Commit bd6d683

Browse files
committed
Shows city names for pin label attribute usng the findNearbyPlaceNameJSON geonames.org query
1 parent 7b145c2 commit bd6d683

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/models/data-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class DataManager {
145145

146146
pluginState.pins.forEach(pin => {
147147
const extractedColor = geoImage.extractColor(pin.lat, pin.long);
148-
const label = pinLabel(pin);
148+
const label = pin.label || pinLabel(pin);
149149
const paletteIndex = this.reversePalette?.[GeoImage.rgbToNumber(extractedColor)] ?? -1;
150150
const paletteValue = neoDataset.paletteToValue(paletteIndex);
151151
const color = paletteValue === null ? {r: 148, g: 148, b: 148} : extractedColor;

src/models/plugin-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import {
99
kPluginName,
1010
kVersion
1111
} from "../data/constants";
12-
import { createOrUpdateMap, createSelectionList, deleteSelectionList, updateSelectionList } from "../utils/codap-utils";
12+
import { createOrUpdateMap, createSelectionList, deleteSelectionList, updateSelectionList,
13+
getMapComponentInfo } from "../utils/codap-utils";
1314
import { NeoDataset } from "./neo-types";
14-
import { getMapComponentInfo } from "../utils/codap-utils";
1515
import { geoLocSearch, MapComponentInfo } from "../utils/location-utils";
1616

1717
export interface IMapPin {

src/utils/codap-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,4 @@ export const getMapComponentInfo = async () => {
199199
} else {
200200
return Promise.reject(mapInfo);
201201
}
202-
}
202+
};

0 commit comments

Comments
 (0)