From 7e06d7a16ad610f696c1e6fb7c7fd70bf54dcdec Mon Sep 17 00:00:00 2001 From: antontranelis <31516529+antontranelis@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:45:10 +0000 Subject: [PATCH] Update README.md --- README.md | 97 +------------------------------------------------------ 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/README.md b/README.md index 423d62ea..602b9aea 100644 --- a/README.md +++ b/README.md @@ -26,103 +26,8 @@ It is the base of [Utopia Map](https://github.com/utopia-os/utopia-map) and [Uto ## Getting Started -### Basic Map -In this tutorial we learn how we create a basic React app with a Map component using [utopia-ui](https://github.com/utopia-os/utopia-ui) library. +See our [`/exampes`](/examples) -For this tutorial we use Vite to create an empty React app called "utopia-static-map" - -```shell -npm create vite@latest utopia-static-map -- --template react -``` - -We open our new app in the terminal and install the [utopia-ui](https://github.com/utopia-os/utopia-ui) package - -```shell -cd utopia-static-map -npm install utopia-ui -``` - -We open our `src/App.jsx` and we replace the content with - -```jsx -import { UtopiaMap } from "utopia-ui" - -function App() { - return ( - - - ) -} - -export default App - -``` - -Then we start the development server to check out the result in our browser: - -```shell -npm run dev -``` - -And can open our first map app in the browser 🙂 - -### Static Layers - -Now we add some static content in two layer. - -First we put some sample data in a new file called `src/sample-data.js` - -```javascript -export const places = [{ - "id": 51, - "name": "Stadtgemüse", - "text": "Stadtgemüse Fulda ist eine Gemüsegärtnerei in Maberzell, die es sich zur Aufgabe gemacht hat, die Stadt und seine Bewohner:innen mit regionalem, frischem und natürlich angebautem Gemüse mittels Gemüsekisten zu versorgen. Es gibt also jede Woche, von Frühjahr bis Herbst, angepasst an die Saison eine Kiste mit schmackhaftem und frischem Gemüse für euch, welche ihr direkt vor Ort abholen könnt. \r\n\r\nhttps://stadtgemuese-fulda.de", - "position": { "type": "Point", "coordinates": [9.632435, 50.560342] }, - }, - { - "id": 166, - "name": "Weidendom", - "text": "free camping", - "position": { "type": "Point", "coordinates": [9.438793, 50.560112] }, - }]; - - export const events = [ - { - "id": 423, - "name": "Hackathon", - "text": "still in progress", - "position": { "type": "Point", "coordinates": [10.5, 51.62] }, - "start": "2022-03-25T12:00:00", - "end": "2022-05-12T12:00:00", - } - ] -``` - -We want to create two Layers. One we want to call *Places* and the other *Events* - -we import our sample data to the `src/App.jsx` - -```jsx -import { events, places } from "./sample-data" -``` -and than we create our two `` inside of our `` component -```jsx - - - - - -``` ## Components ![Utopia UI Components](Components.svg)