-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) => { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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文省く
Close #295
Coordinates の 値が文字列の GeoJSON(例:
'coordinates': [ '139.77012634277344','35.68518697509636']
)を、SimpleStyle クラスに渡した時に、コンソールに waning を表示するように修正しました。ワーニングのテキストを、
GeoJSON coordinate value must be number
にしているのですが、もしベターな表現があれば教えていただけるとありがたいです。(GeoJSON longitude and latitude should be number
等のほうが良い、、??)