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

map表示を考える #20

Open
306-san opened this issue May 25, 2018 · 13 comments
Open

map表示を考える #20

306-san opened this issue May 25, 2018 · 13 comments

Comments

@306-san
Copy link
Owner

306-san commented May 25, 2018

No description provided.

@306-san
Copy link
Owner Author

306-san commented May 25, 2018

経路がわかりづらいので、Mapで示す

@306-san
Copy link
Owner Author

306-san commented May 25, 2018

せっかくなのでReact使いたいお気持ち

@306-san
Copy link
Owner Author

306-san commented May 28, 2018

だめだ。Reactがわからない

@306-san
Copy link
Owner Author

306-san commented May 28, 2018

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

生JSでごりごり実装

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

image
本場・・・

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

image
開発環境・・・

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

なぜか同じseedデータなのに経路が違うぞい

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

本番がポスグレ、ローカルがMySQLなのがいかんのか?

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

入ってる駅の座標の配列の2番めのデータが違いますね

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

本番

irb(main):005:0> Onestroke.first.stations
D, [2018-05-29T00:35:04.061865 #5] DEBUG -- :   Onestroke Load (7.6ms)  SELECT  "onestrokes".* FROM "onestrokes" ORDER BY "onestrokes"."id" ASC LIMIT $1  [["LIMIT", 1]]
D, [2018-05-29T00:35:04.082009 #5] DEBUG -- :   Station Load (1.5ms)  SELECT  "stations".* FROM "stations" INNER JOIN "onestroke_stations" ON "stations"."id" = "onestroke_stations"."station_id" WHERE "onestroke_stations"."onestroke_id" = $1 LIMIT $2  [["onestroke_id", 18], ["LIMIT", 11]]
=> #<ActiveRecord::Associations::CollectionProxy [#<Station id: 54, name: "東京", longitude: 0.139766103e3, latitude: 0.35681391e2, created_at: "2018-05-23 02:09:29", updated_at: "2018-05-23 02:09:29">, #<Station id: 200, name: "上野", longitude: 0.139777043e3, latitude: 0.3571379e2, created_at: "2018-05-23 02:11:08", updated_at: "2018-05-23 02:11:08">, #<Station id: 200, name: "上野", longitude: 0.139777043e3, latitude: 0.3571379e2, created_at: "2018-05-23 02:11:08", updated_at: "2018-05-23 02:11:08">, #<Station id: 198, name: "日暮里", longitude: 0.139771287e3, latitude: 0.35727908e2, created_at: "2018-05-23 02:11:08", updated_at: "2018-05-23 02:11:08">, #<Station id: 542, name: "三河島", longitude: 0.139777131e3, latitude: 0.35733383e2, created_at: "2018-05-23 02:17:30", updated_at: "2018-05-23 02:17:30">, #<Station id: 543, name: "南千住", longitude: 0.1397994e3, latitude: 0.35734033e2, created_at: "2018-05-23 02:17:30", updated_at: "2018-05-23 02:17:30">, #<Station id: 528, name: "北千住", longitude: 0.139804872e3, latitude: 0.35749677e2, created_at: "2018-05-23 02:16:59", updated_at: "2018-05-23 02:16:59">, #<Station id: 532, name: "松戸", longitude: 0.139900779e3, latitude: 0.35784472e2, created_at: "2018-05-23 02:16:59", updated_at: "2018-05-23 02:16:59">, #<Station id: 538, name: "柏", longitude: 0.139971148e3, latitude: 0.35862316e2, created_at: "2018-05-23 02:17:00", updated_at: "2018-05-23 02:17:00">, #<Station id: 540, name: "我孫子", longitude: 0.140010466e3, latitude: 0.3587279e2, created_at: "2018-05-23 02:17:00", updated_at: "2018-05-23 02:17:00">, ...]>
irb(main):006:0> Onestroke.first.stations.all

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

開発

[3] pry(main)> Onestroke.first.stations
  Onestroke Load (0.4ms)  SELECT  `onestrokes`.* FROM `onestrokes` ORDER BY `onestrokes`.`id` ASC LIMIT 1
=>   Station Load (0.7ms)  SELECT `stations`.* FROM `stations` INNER JOIN `onestroke_stations` ON `stations`.`id` = `onestroke_stations`.`station_id` WHERE `onestroke_stations`.`onestroke_id` = 26
[#<Station:0x00007fbcf126f8a8 id: 54, name: "東京", longitude: 0.139766103e3, latitude: 0.35681391e2, created_at: Mon, 21 May 2018 02:25:14 UTC +00:00, updated_at: Mon, 21 May 2018 02:25:14 UTC +00:00>,
 #<Station:0x00007fbcf126f650 id: 200, name: "上野", longitude: 0.139777043e3, latitude: 0.3571379e2, created_at: Mon, 21 May 2018 02:26:26 UTC +00:00, updated_at: Mon, 21 May 2018 02:26:26 UTC +00:00>,
 #<Station:0x00007fbcf126f4c0 id: 183, name: "大宮", longitude: 0.13962405e3, latitude: 0.35906439e2, created_at: Mon, 21 May 2018 02:26:26 UTC +00:00, updated_at: Mon, 21 May 2018 02:26:26 UTC +00:00>,
 #<Station:0x00007fbcf126f330 id: 53, name: "小山", longitude: 0.139806241e3, latitude: 0.36312747e2, created_at: Mon, 21 May 2018 02:24:59 UTC +00:00, updated_at: Mon, 21 May 2018 02:24:59 UTC +00:00>,
 #<Station:0x00007fbcf126f1f0 id: 437, name: "宇都宮", longitude: 0.139898389e3, latitude: 0.36559246e2, created_at: Mon, 21 May 2018 02:29:33 UTC +00:00, updated_at: Mon, 21 May 2018 02:29:33 UTC +00:00>,
 #<Station:0x00007fbcf126efc0 id: 446, name: "那須塩原", longitude: 0.140020694e3, latitude: 0.36931956e2, created_at: Mon, 21 May 2018 02:29:34 UTC +00:00, updated_at: Mon, 21 May 2018 02:29:34 UTC +00:00>,
 #<Station:0x00007fbcf126ede0 id: 599, name: "新白河", longitude: 0.140188969e3, latitude: 0.3712331e2, created_at: Mon, 21 May 2018 02:33:44 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:44 UTC +00:00>,
 #<Station:0x00007fbcf126ec50 id: 607, name: "郡山", longitude: 0.140389363e3, latitude: 0.37398187e2, created_at: Mon, 21 May 2018 02:33:45 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:45 UTC +00:00>,
 #<Station:0x00007fbcf126eac0 id: 617, name: "福島", longitude: 0.14045968e3, latitude: 0.37754123e2, created_at: Mon, 21 May 2018 02:33:45 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:45 UTC +00:00>,
 #<Station:0x00007fbcf126e980 id: 1015, name: "白石蔵王", longitude: 0.140632881e3, latitude: 0.37995052e2, created_at: Mon, 21 May 2018 02:41:12 UTC +00:00, updated_at: Mon, 21 May 2018 02:41:12 UTC +00:00>,
 #<Station:0x00007fbcf126e7f0 id: 635, name: "仙台", longitude: 0.140882158e3, latitude: 0.38260027e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126e6b0 id: 635, name: "仙台", longitude: 0.140882158e3, latitude: 0.38260027e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126e4d0 id: 634, name: "長町", longitude: 0.140885986e3, latitude: 0.38226797e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126e390 id: 633, name: "太子堂", longitude: 0.140883436e3, latitude: 0.3821711e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126e250 id: 632, name: "南仙台", longitude: 0.140883295e3, latitude: 0.38197384e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126e0c0 id: 631, name: "名取", longitude: 0.140882753e3, latitude: 0.38173017e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126df80 id: 630, name: "館腰", longitude: 0.140880208e3, latitude: 0.38142987e2, created_at: Mon, 21 May 2018 02:33:46 UTC +00:00, updated_at: Mon, 21 May 2018 02:33:46 UTC +00:00>,
 #<Station:0x00007fbcf126de40 id: 527, name: "岩沼", longitude: 0.140863783e3, latitude: 0.3811205e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126dd00 id: 527, name: "岩沼", longitude: 0.140863783e3, latitude: 0.3811205e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126dbc0 id: 526, name: "逢隈", longitude: 0.140854669e3, latitude: 0.38067584e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126da80 id: 525, name: "亘理", longitude: 0.140861317e3, latitude: 0.38039776e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126d940 id: 524, name: "浜吉田", longitude: 0.140890083e3, latitude: 0.38002195e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126d710 id: 523, name: "山下", longitude: 0.140900688e3, latitude: 0.37967292e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126d4e0 id: 522, name: "坂元", longitude: 0.140912727e3, latitude: 0.37928454e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126d328 id: 521, name: "新地", longitude: 0.140926501e3, latitude: 0.37881123e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126c9c8 id: 520, name: "駒ヶ嶺", longitude: 0.140925075e3, latitude: 0.37842353e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126c838 id: 519, name: "相馬", longitude: 0.140925713e3, latitude: 0.37802455e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126c5e0 id: 518, name: "日立木", longitude: 0.140934642e3, latitude: 0.37756081e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,
 #<Station:0x00007fbcf126c450 id: 517, name: "鹿島", longitude: 0.140970062e3, latitude: 0.37702827e2, created_at: Mon, 21 May 2018 02:30:55 UTC +00:00, updated_at: Mon, 21 May 2018 02:30:55 UTC +00:00>,

@306-san
Copy link
Owner Author

306-san commented May 29, 2018

返ってくる結果が違うので、中間テーブルからsortすればいいかな。。。

306-san added a commit that referenced this issue May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant