From 9b6143d46ee07ac87ae253cacb0c57e6bfc07e15 Mon Sep 17 00:00:00 2001 From: AT Date: Sat, 9 Jul 2022 20:53:43 +0200 Subject: [PATCH] you can pass places and events now and also set center and zoom --- package.json | 2 +- src/index.tsx | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index c3522d36..50dfdd12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "1.0.3", + "version": "1.0.4", "description": "Reuseable React Components to build mapping apps for all kinds of communities ", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia.os/", diff --git a/src/index.tsx b/src/index.tsx index 49dfb9c1..6c7d0c2d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,37 +3,38 @@ import "leaflet/dist/leaflet.css"; import * as React from "react"; import MarkerIconFactory from './Utils/MarkerIconFactory'; import MarkerPopup, { IMapItem } from "./Components/Map/MarkerPopup"; -import { places, events } from './sampleData/data' import "./styles.scss" export interface IMapProps { height: string, width: string, + center: number[], + zoom: number, places?: IMapItem[], - events?: IMapItem[] + events?: IMapItem[], + children?: any, + data?: any, } const Map = (props: IMapProps) => { - return ( - + + - - {places && - (places).map((place) => ( - - - - )) - } + {props.places && + (props.places).map((place: IMapItem) => ( + + + + )) + } - {events && - (events).map((event) => ( + {props.events && + (props.events).map((event: IMapItem) => (