質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -161,39 +161,3 @@
|
|
161
161
|
https://stackoverflow.com/questions/39719139/change-the-size-of-marker-in-googlemap-using-swift/39719578
|
162
162
|
|
163
163
|
を参考にしました。
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
``` Swift
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
marker.icon = self.imageWithImage(image: UIImage(named: "camera_1")!, scaledToSize: CGSize(width: 30.0, height: 30.0))
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
func imageWithImage(image:UIImage, scaledToSize newSize:CGSize) -> UIImage{
|
180
|
-
|
181
|
-
UIGraphicsBeginImageContextWithOptions(newSize, false, 10.0)
|
182
|
-
|
183
|
-
image.draw(in: CGRect(x: 10, y: 10, width: newSize.width, height: newSize.height))
|
184
|
-
|
185
|
-
let newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
|
186
|
-
|
187
|
-
UIGraphicsEndImageContext()
|
188
|
-
|
189
|
-
return newImage
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
```
|
198
|
-
|
199
|
-
このコードを書いてみたのですがピンが表示されなくなりました。。。
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -158,4 +158,42 @@
|
|
158
158
|
|
159
159
|
https://developers.google.com/maps/documentation/ios-sdk/marker
|
160
160
|
|
161
|
+
https://stackoverflow.com/questions/39719139/change-the-size-of-marker-in-googlemap-using-swift/39719578
|
162
|
+
|
161
163
|
を参考にしました。
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
``` Swift
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
marker.icon = self.imageWithImage(image: UIImage(named: "camera_1")!, scaledToSize: CGSize(width: 30.0, height: 30.0))
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
func imageWithImage(image:UIImage, scaledToSize newSize:CGSize) -> UIImage{
|
180
|
+
|
181
|
+
UIGraphicsBeginImageContextWithOptions(newSize, false, 10.0)
|
182
|
+
|
183
|
+
image.draw(in: CGRect(x: 10, y: 10, width: newSize.width, height: newSize.height))
|
184
|
+
|
185
|
+
let newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
|
186
|
+
|
187
|
+
UIGraphicsEndImageContext()
|
188
|
+
|
189
|
+
return newImage
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
```
|
198
|
+
|
199
|
+
このコードを書いてみたのですがピンが表示されなくなりました。。。
|