回答編集履歴

1

カメラおよび画像から取得においてMonacaDebuggerで動くまで確認できたソースに変更

2018/11/13 16:48

投稿

rururu3
rururu3

スコア5545

test CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
20
20
 
21
- <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
21
+ <meta http-equiv="Content-Security-Policy" content="default-src * data: content:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
22
22
 
23
23
  <script src="components/loader.js"></script>
24
24
 
@@ -76,12 +76,6 @@
76
76
 
77
77
  sourceType : Camera.PictureSourceType.CAMERA,
78
78
 
79
- saveToPhotoAlbum: true,
80
-
81
- correctOrientation: true,
82
-
83
- destinationType: Camera.DestinationType.FILE_URI
84
-
85
79
  };
86
80
 
87
81
  navigator.camera.getPicture(function(imageURI){
@@ -118,7 +112,17 @@
118
112
 
119
113
  });
120
114
 
121
- myNavi.pushPage('image.html');
115
+ $('#myNavigator')[0].pushPage('image.html')
116
+
117
+ .then(function() {
118
+
119
+ console.log(pictureUrl);
120
+
121
+ console.log(document.getElementById("photo"));
122
+
123
+ document.getElementById("photo").src = pictureUrl;
124
+
125
+ });
122
126
 
123
127
  }
124
128
 
@@ -172,7 +176,7 @@
172
176
 
173
177
  <body>
174
178
 
175
- <ons-navigator var="myNavi">画面の切り替え
179
+ <ons-navigator id="myNavigator">画面の切り替え
176
180
 
177
181
  <ons-page id="main-page">
178
182
 
@@ -224,6 +228,8 @@
224
228
 
225
229
  </ons-toolbar>
226
230
 
231
+ <img id="photo" src="">
232
+
227
233
  <ons-carousel var="imageCarousel" class="image-carousel" fullscreen auto-scroll overscrollable>
228
234
 
229
235
  </ons-carousel>