Skip to content

Commit 8ddb2c4

Browse files
committed
fix: Added code README
1 parent 4800668 commit 8ddb2c4

File tree

3 files changed

+99
-23
lines changed

3 files changed

+99
-23
lines changed

.vscode/cody.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Improve variable names": {
3+
"prompt": "Suppose that you are writing code for a production level application which is shared by many developers in your team. Take the current code, and update the variable names so that it should improve the readability of the code and help the other developers maintain it without much difficulty.",
4+
"context": {
5+
"codebase": false,
6+
"selection": true
7+
}
8+
},
9+
"readme": {
10+
"description": "Readme for current dir",
11+
"prompt": "Write a detailed README.md file to document the code located in the same directory as my current selection. Summarize what the code in this directory is meant to accomplish. Explain the key files, functions, classes, and features. Use Markdown formatting for headings, code blocks, lists, etc. to make the it organized and readable. Aim for a beginner-friendly explanation that gives a developer unfamiliar with the code a good starting point to understand it. Make sure to include: - Overview of directory purpose - Functionality explanations - Relevant diagrams or visuals if helpful. Write the README content clearly and concisely using complete sentences and paragraphs based on the shared context. Use proper spelling, grammar, and punctuation throughout. Surround your full README text with triple backticks so it renders properly as a code block. Do not make assumptions or fabricating additional details.",
12+
"context": {
13+
"currentDir": true,
14+
"selection": true
15+
}
16+
}
17+
}

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# GEOComp Component
2+
3+
The `src` directory contains the source code for the GEOComp React component. GEOComp renders an interactive geographic map using the OpenLayers library.
4+
5+
## Overview
6+
7+
GEOComp is a reusable map component that can be configured and integrated into other applications. It allows displaying geographic data layers, interactivity through popups and drawing, and exposes events for integrating custom functionality.
8+
9+
Some key capabilities provided by GEOComp:
10+
11+
- Configurable base map layers
12+
- Overlay vector data layers from files or API sources
13+
- Interaction through popups, selection, and drawing tools
14+
- Expose map events and selected features
15+
- Timeline animation of temporal data
16+
- Customizable styling
17+
18+
## Key Files
19+
20+
Within the main directory you will find the following files creating the lowcoder plugin
21+
22+
- `GEOComp.tsx` - Main component definition and configuration
23+
- `LayersControl.tsx` - Builds layer configuration UI
24+
- `FeaturesControl.tsx` - Feature flags configuration
25+
- `vendors/index.ts` - OpenLayers map initialization and helpers
26+
- `styles.module.css` - Component styling
27+
28+
## Component Configuration
29+
30+
GEOComp is configured through React props that control the map options and layers. Some key configuration props:
31+
32+
- `center` - Initial center point [lon, lat]
33+
- `zoom` - Initial zoom level
34+
- `layers` - Array of layer configuration objects
35+
- `events` - Object mapping event names to handlers
36+
- `feature` - Selected/edited feature state
37+
38+
## Events and Interactivity
39+
40+
GEOComp exposes events that can be handled in the parent component:
41+
42+
- `onInit` - Map initialized
43+
- `onLoad` - Layers loaded
44+
- `onClick` - Map clicked
45+
- `onSelect` - Feature clicked
46+
- `onModify` - Draw layer edited
47+
48+
This allows integrating custom popup content, selection logic, etc.
49+
50+
## Styling
51+
52+
GEOComp uses CSS modules for styling control. The `styles` prop accepts configuration for:
53+
54+
- Padding
55+
- Text sizing
56+
- Background color
57+
- Borders
58+
- Border radius
59+
60+
This allows adapating the visual style.
61+
62+
# Building the plugin
63+
64+
Before you start make your you have a up-to-date version on node installed locally.
65+
66+
Start with cloning the repository on to you local hard drive. Install all dependecies and start te component test environment. Make any changes to the code you want and the will be visible in the test environment.
67+
68+
```bash
69+
git clone https://github.com/sjhoeksma/lowcoder-comp-geo.git
70+
cd lowcoder-comp-geo
71+
yarn install
72+
yarn start
73+
```
74+
75+
When you are finished you can build your own version or deploy it to npmjs
76+
77+
```bash
78+
# Building
79+
yarn build
80+
# Or Publishing
81+
yarn build --publish
82+
```

src/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,3 @@ To help you with understanding how you can use this plugin we have added an [exa
1212

1313
#### Viewer
1414
![viewer](https://github.com/sjhoeksma/lowcoder-comp-geo/blob/main/images/viewer-example.png?raw=true)
15-
16-
# Development
17-
18-
Before you start make your you have a up-to-date version on node installed locally.
19-
20-
Start with cloning the repository on to you local hard drive. Install all dependecies and start te component test environment. Make any changes to the code you want and the will be visible in the test environment.
21-
22-
```bash
23-
git clone https://github.com/sjhoeksma/lowcoder-comp-geo.git
24-
cd lowcoder-comp-geo
25-
yarn install
26-
yarn start
27-
```
28-
29-
When you are finished you can build your own version or deploy it to npmjs
30-
31-
```bash
32-
# Building
33-
yarn build
34-
# Or Publishing
35-
yarn build --publish
36-
```

0 commit comments

Comments
 (0)