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

[市区町村地図]地図をカード内に表示する #614

Closed
Blue-Tone opened this issue Aug 19, 2020 · 3 comments
Closed

[市区町村地図]地図をカード内に表示する #614

Blue-Tone opened this issue Aug 19, 2020 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Blue-Tone
Copy link

Blue-Tone commented Aug 19, 2020

親Issue

#281 市区町村毎の感染者数をビジュアルに表示したい

作業ブランチ

https://github.com/codeforosaka/covid19/tree/feature/municipality_map

起こっている問題 / The Problem

  • 地図がはみ出している。カード内に収まるようにする。

スクリーンショット / Screenshot

スクリーンショット 2020-05-17 2 19 47

期待する見せ方・挙動 / Expected Behavior

  • カード内に収まること
  • カードのサイズ変更に地図の大きさが追従すること
  • スマートフォンでもレイアウトが崩れないこと

起こっている問題の再現手段 / Steps to Reproduce

  1. ブランチmunicipality_mapでメイン画面を表示する

動作環境・ブラウザ / Environment

  • any
  • macOS / Windows / Linux / iOS / Android
  • Chrome / Safari / Firefox / Edge / Internet Explorer

改修箇所

components/GraphicalMapCard.vue
drawOsaka()

以下のscale、translate辺りを動的に調整が必要そう。
茨城のサイトを参考にするといいかも。

      // 投影を処理する関数を用意する。データからSVGのPATHに変換するため。
      projection = d3
        .geoMercator()
        .scale(scale)
        .center(d3.geoCentroid(json)) // データから中心点を計算 .center(d3.geoCentroid(json))
        .translate([width / 2, height / 2]) // ブラウザの中央に転移

また、<g>の位置がおかしそう。<div id="map">の位置に合わせると良さそう。
→追記:L157辺りの.append('g')を削除したら、<g>問題は解決しているように見える。

<g>
スクリーンショット 2020-08-20 7 09 13

<div id="map">
スクリーンショット 2020-08-20 7 09 04

@Blue-Tone Blue-Tone added the bug Something isn't working label Aug 19, 2020
@Blue-Tone Blue-Tone changed the title [市区町村地図]地図がはみ出している。カード内に収まるようにする。 [市区町村地図]地図がはみ出しているので、カード内に収まるようにする Aug 19, 2020
@Blue-Tone Blue-Tone changed the title [市区町村地図]地図がはみ出しているので、カード内に収まるようにする [市区町村地図]地図をカード内に表示する Aug 19, 2020
@Blue-Tone
Copy link
Author

対応してくれる方、募集中です。

@aktuehr
Copy link

aktuehr commented Aug 20, 2020

必要なパラメータの制御の箇所は把握しました。
レスポンシブでどういった対応になりそうかは少し考えてみます。

Blue-Tone added a commit that referenced this issue Aug 21, 2020
…-card

fix #614 [市区町村地図]地図をカード内に表示する
@Blue-Tone
Copy link
Author

PRマージで解決。
クローズします。

ナイスコミットです。ありがとうございます!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants