質問編集履歴

2

より詳しく修正しました

2016/11/03 10:53

投稿

yuyuyudaria
yuyuyudaria

スコア7

test CHANGED
File without changes
test CHANGED
@@ -371,3 +371,91 @@
371
371
  }
372
372
 
373
373
  ```
374
+
375
+
376
+
377
+ 以下の部分が位置情報を持ってくる記述になります。
378
+
379
+ 成功した場合にconsole logに表記がされるように記述しているのですが、何も表示されません。
380
+
381
+
382
+
383
+ ```JavaScript
384
+
385
+ //店舗名、位置情報、Google mapオブジェクトを指定してマーカー作成メソッドを呼び出し
386
+
387
+ markToMap(point.get("name"), myLatlng, map);
388
+
389
+ }
390
+
391
+ function markToMap(name, position, map){
392
+
393
+ var marker = new google.maps.Marker({
394
+
395
+ position: position,
396
+
397
+ title:name
398
+
399
+ });
400
+
401
+ marker.setMap(map);
402
+
403
+ google.maps.event.addListener(marker, 'click', function() {
404
+
405
+
406
+
407
+ var test = '<a href = "page3.html">' + name + '</a>';
408
+
409
+ var imgPull;
410
+
411
+
412
+
413
+ spot.equalTo("geo", position).fetchAll().then(function(results) {
414
+
415
+ imgPull = results[0].get('img');
416
+
417
+ console.log("おっけー");
418
+
419
+ });
420
+
421
+
422
+
423
+ var infowindow = new google.maps.InfoWindow({
424
+
425
+ //content:marker.title
426
+
427
+ content: test,
428
+
429
+ //content: '<ons-button onclick="myNavigator.pushPage('page3.html')">スポットを登録</ons-button>'
430
+
431
+
432
+
433
+ //content: '<b>aaaa</b>'
434
+
435
+ });
436
+
437
+ infowindow.open(map,marker);
438
+
439
+ });
440
+
441
+ }
442
+
443
+
444
+
445
+ },
446
+
447
+ error: function(error) {
448
+
449
+ // 検索に失敗した場合の処理
450
+
451
+ console.log(error.message);
452
+
453
+ }
454
+
455
+ });
456
+
457
+ }
458
+
459
+
460
+
461
+ ```

1

不十分な情報量だったので付け足しました。

2016/11/03 10:53

投稿

yuyuyudaria
yuyuyudaria

スコア7

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,18 @@
8
8
 
9
9
 
10
10
 
11
+ >>追記
12
+
13
+ エラーは出ておらず、ピンをタップしたら位置データをデータストアから持ってくるようにしたいのですが、コードのどこがおかしくてデータを持ってこれないのかがわかりません。
14
+
15
+ 実行結果は以下のようになっております。
16
+
17
+ ![実行結果のスクリーンショット](b582aec1d381ae25a253575e52a61fcc.png)
18
+
19
+
20
+
21
+
22
+
11
23
  参考にしたサイト> http://mb.cloud.nifty.com/doc/current/tutorial/monaca_checkIn.html
12
24
 
13
25