Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
gsambrotta
left a comment
There was a problem hiding this comment.
Nice work and very well documented. Thank you for this, Luke.
Some minor comments here
| The Map block expects incoming data to be an array of objects. | ||
| Each object represents a marker, and/or a country area. Each object can include the following properties: | ||
|
|
||
| - **Location-based Pin:** Provide both ``lat`` and ``long`` properties to display a pin at the specified coordinates. |
There was a problem hiding this comment.
Can you please write the properties exactly as they are in the object? We do like this in all the other blocks and common way of documenting.
So in this case it would be:
customPin: explanation
lat
long
label
and so on.
There was a problem hiding this comment.
An example made by you ;) here: https://github.com/kendraio/kendraio-app/pull/477/files#diff-4354ba88bbed0d8a4f177a6a9a4523155e8e57b2af6e29029d98396e6f5fc8fdR20
|
|
||
| Optionally, include a ``label`` property for the popup label and a ``customPin`` property for custom icons (see below). | ||
|
|
||
| **Example: Displaying location pins** |
There was a problem hiding this comment.
Can we keep the format of "Examples" as chapter title and then the examples name as subtitle?
Like we do here: https://kendraio-app.readthedocs.io/en/latest/workflow/blocks/actions.html
| "type": "mapping", | ||
| "mapping": "data[?recovered > `20`].{ lat: lat, long: long, label: join(' ', [to_string(recovered), 'recovered in', combinedKey][? @ != null]) }" | ||
| } | ||
| { |
There was a problem hiding this comment.
This is not clear to me. Where this countryStyle object should stay? Is another property of the object containing the country, the lat and long? Or where it stays?
| } | ||
|
|
||
| Example map block configuration: | ||
| **Example: Displaying country areas** |
There was a problem hiding this comment.
I would suggest getting rid of this title and the countryStyle code and directly write the complete code example.
There was a problem hiding this comment.
I would say you can even write an example with the customPin. Is clear enough, I don't think it needs two separate example for it.
|
|
||
| **Example: Custom pin icons with emojis** | ||
|
|
||
| This example uses emojis as custom pin icons for specific locations: |
There was a problem hiding this comment.
I am confuse, I don't see any difference between this customPinvalue and previous example customPin value
| component = fixture.componentInstance; | ||
| }); | ||
|
|
||
| it("should create", () => { |
There was a problem hiding this comment.
it should create... what? :)
| lat: `51.5074`, | ||
| long: `-0.1278`, | ||
| label: "London", | ||
| customPin: "📍", |
There was a problem hiding this comment.
shouldn't this be plain text?
| markerClusterOptions = {}; | ||
|
|
||
| // Country GeoJSON provider base URL | ||
| countryProviderBaseURL = 'https://raw.githubusercontent.com/AshKyd/geojson-regions/main/public/countries/50m/'; |
There was a problem hiding this comment.
These are static values, right?
Can you please write them in uppercase and outside the component? So they do not get re-render/re-computed
| onConfigUpdate(config: any) { | ||
| this.height = get(config, 'height', 500); | ||
| set(this.options, 'zoom', get(config, 'zoom', 8)); | ||
| const latln = get(config, 'latlng', [51.505, -0.09]); |
There was a problem hiding this comment.
Where do these static values come from? 500, 8 and [51,505, -0,09] Would be great to know. Maybe add a comment on the code?
| }); | ||
| } | ||
|
|
||
| if (lat && long) { |
There was a problem hiding this comment.
Is it reasonable to create an object without LAT and LONG? Aren't they indispensable information to work with a map?
There was a problem hiding this comment.
A country is an area, and so is a LAT and LONG, it is just smaller, as a point.
There was a problem hiding this comment.
Honestly @lukestanley I do not understand this comment. Can you help me understand better what do you mean?
My question is: Can map object exist and be valid without a LAT and LONG? If yes, how come?
Makes Map block able to accept a "country" property in the array of map points it processes, that show as an area, the values must be 3 letter ISO country codes.
Shading for area can be adjusted.
Custom map pin points may be set to an emoji flag.
Documentation has been updated.
A unit tests file for the block was added.
This should meet requirements for: #483