Compare commits

...

4 Commits

Author SHA1 Message Date
Leonardo Yuri Farias
1394f02038 Merge pull request #1062 from datopian/changeset-release/main
Version Packages
2023-12-19 22:25:59 -03:00
github-actions[bot]
e687779fa6 Version Packages 2023-12-20 01:22:46 +00:00
Leonardo Yuri Farias
2ec143707d Merge pull request #1061 from datopian/feature/style-in-map-component
Created the style property for the map component
2023-12-19 22:20:07 -03:00
Leonardo Farias
4ddfc1126a Created the style property for the map component 2023-12-19 22:16:57 -03:00
4 changed files with 19 additions and 7 deletions

View File

@@ -1,5 +1,11 @@
# @portaljs/components
## 0.5.1
### Patch Changes
- [#1061](https://github.com/datopian/portaljs/pull/1061) [`4ddfc112`](https://github.com/datopian/portaljs/commit/4ddfc1126a3f0b8137ea47a08a36c56b7373b8f6) Thanks [@Gutts-n](https://github.com/Gutts-n)! - Created the style property in the Map component
## 0.5.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@portaljs/components",
"version": "0.5.0",
"version": "0.5.1",
"type": "module",
"description": "https://portaljs.org",
"keywords": [

View File

@@ -30,6 +30,7 @@ export type MapProps = {
title?: string;
center?: { latitude: number | undefined; longitude: number | undefined };
zoom?: number;
style?: Object;
};
export function Map({
@@ -44,6 +45,7 @@ export function Map({
center = { latitude: 45, longitude: 45 },
zoom = 2,
title = '',
style = {}
}: MapProps) {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [layersData, setLayersData] = useState<any>([]);
@@ -96,6 +98,7 @@ export function Map({
zoom={zoom}
scrollWheelZoom={false}
className="h-80 w-full"
style={style ?? {}}
// @ts-ignore
whenReady={(map: any) => {
// Enable zoom using scroll wheel
@@ -104,13 +107,13 @@ export function Map({
// Create the title box
var info = new L.Control() as any;
info.onAdd = function () {
info.onAdd = function() {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
};
info.update = function () {
info.update = function() {
this._div.innerHTML = `<h4 style="font-weight: 600; background: #f9f9f9; padding: 5px; border-radius: 5px; color: #464646;">${title}</h4>`;
};

View File

@@ -21,6 +21,9 @@ const meta: Meta = {
zoom: {
description: 'Zoom level',
},
style: {
description: "Styles for the container"
}
},
};