Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warning on console when coordinate is string #296

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

naogify
Copy link
Member

@naogify naogify commented Jun 17, 2022

Close #295

Coordinates の 値が文字列の GeoJSON(例: 'coordinates': [ '139.77012634277344','35.68518697509636'])を、SimpleStyle クラスに渡した時に、コンソールに waning を表示するように修正しました。

ワーニングのテキストを、GeoJSON coordinate value must be number にしているのですが、もしベターな表現があれば教えていただけるとありがたいです。(GeoJSON longitude and latitude should be number 等のほうが良い、、??)

@naogify naogify requested a review from keichan34 June 17, 2022 08:15
Copy link
Member

@keichan34 keichan34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

調整お願いします 🙇


if (geojson.features) {

geojson.features.forEach((feature) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (const feature of geojson.features || []) { で直前のif文も省ける
基本的に for .. of 使いましょう


if (feature.geometry.coordinates) {

const coordinates = feature.geometry.coordinates.flat(3); // flatten array for each geometry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(feature.geometry.coordinates || []).flat(3) でif文省く

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants