Skip to content

Commit

Permalink
fix: correct ui scope
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Aug 16, 2021
1 parent 9c2ae3e commit 70d08b5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/annotations/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const ImageAnnotation = (props: ImageProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);

if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const coords = new mapkit.value.Coordinate(
props.coordinates[0],
props.coordinates[1],
Expand Down
2 changes: 1 addition & 1 deletion src/components/annotations/Marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const MarkerAnnotation = (props: MarkerProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);

if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const coords = new mapkit.value.Coordinate(
props.coordinates[0],
props.coordinates[1],
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useGlobalState } from '../../utils/store';
export const CircleOverlay = (props: CircleOverlayProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);
if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const radius: Ref<number> = ref(props['circle-radius'] || 1);
const coords = new mapkit.value.Coordinate(
props['circle-coordinates'][0],
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const PolygonOverlay = (props: PolygonOverlayProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);

if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const points = props['polygon-coordinates'].map((point) => {
return new mapkit.value.Coordinate(point[0], point[1]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Polyline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const PolylineOverlay = (props: PolylineOverlayProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);

if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const coords = props['polyline-coordinates'].map((point) => {
return new mapkit.value.Coordinate(point[0], point[1]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/overlays/Tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const TileOverlay = (props: TileOverlayProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);

if (state.mapLoad && state.map.value) {
if (state.ui.init && state.ui.load && state.map.value) {
const options: Ref<mapkit.TileOverlayConstructorOptions> = ref(
props.options || {},
);
Expand Down

0 comments on commit 70d08b5

Please sign in to comment.