I'm using google maps in my iOS project. I'm currently using .png icons as my marker icons but those are blurred no matter what quality it is. svg icons are the best to my understand in this case. Does anyone know better way or how to use svg in iOS goole maps??
Asked
Active
Viewed 1,114 times
0
-
see this http://stackoverflow.com/questions/24149785/xcode-6-allows-vector-image-assets-any-idea-how-to-use-them – Anbu.Karthik Feb 06 '17 at 06:40
-
https://icons8.com/articles/how-to-use-vectors-in-xcode-7/ – Anbu.Karthik Feb 06 '17 at 06:41
-
@anushka natively ios not supporting svg so you should use png. Have you added different resolution image for that icon ? and have you tested it on real device for resolution. – Nikunj Damani Feb 06 '17 at 06:43
-
Do you want to create your own SVG icon? Or they already comes from google maps? These PNG files is to small. You would need to get bigger. – Ramis Feb 06 '17 at 06:44
2 Answers
0
Starting Xcode 12, iOS now supports SVG natively.
Based on this SVG, just create a UIImage
and add it as an icon to your google map marker.
Asset Catalogs
Added support for Scalable Vector Graphic (SVG) image assets. These preserve their vector representation with deployment targets of macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later. (18389814)
ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes

Ted
- 22,696
- 11
- 95
- 109
0
Convert image file to pdf using an image editing tool. And add the pdf image to the 'assets catalog. Don't forget to enable the 'preserve vector data' option on the attributed inspector.

M.Nadeeshan
- 251
- 4
- 8