Using Google Maps JavaScript to Import KML Files and Automatically Draw Maps


layout: post
title: Using Google Maps Javascript to Import KML Files and Automatically Draw Maps
date: 2021-08-24 17:41 +8
description: How to use KmlLayer to present data without manually reading it, and potential issues you may encounter.
toc: false
share: true
comments: true
tags: GoogleMaps Javascript Development

Code

Potential Issues

Line thickness differs from what you see on Google My Maps or Google Earth! Why is it so thick?

You need to manually add <width>0.001</width> for each <LineStyle></LineStyle> in the KML file.
0.001 can be changed to your desired value.
Tip: Find and replace </LineStyle> with <width>0.001</width></LineStyle>

Various personal issues with Jekyll


layout: post
title: Jekyll tips
date: 2021-08-21 17:41 +8
description: Various personal issues with Jekyll
toc: false
share: true
comments: true
tags: Jekyll Development

Compilation Issues

ffi-1.11.1-x64-mingw32 requires ruby version < 2.7.dev, >= 2.2, which is incompatible with the current version, ruby 2.7.4p191
In 2019, I used Ruby 2.5, and in 2021, I switched to another computer and started using Ruby 2.7.4. As a result, the original project failed to deploy with bundle exec jekyll serve.

Solution: Run bundle update to see if it resolves the issue.

Common Issues with Xamarin iOS


layout: post
title: Common Issues with Xamarin iOS
date: 2021-08-21 15:57 +8
description: Various personal issues encountered when compiling and deploying with Xamarin iOS
toc: false
share: true
comments: true
tags: Xamarin iOS Development VisualStudio

Study Notes

Testflight

  1. Since uploading to the store may encounter unforeseen issues (thanks to Apple), it's best to upload a new version a week before the app expires!
  2. As long as the Testflight app has not expired, you can reuse the original version number by just incrementing the Build Number. This way, users don't need to reload the app, and you don't have to wait for Apple's review.
  3. The review process usually takes about two to three days.

Visual Studio 2019 (Windows) + macOS on VMWare Workstation Pro

Q: Uploading keeps showing "altool" exited with code 1.?

It might be that the app-specific password is incorrect or the SDK is outdated, so update XCode and Visual Studio.
Visual Studio can't display the exact error; to see the exact error, go to macOS's XCode > Windows > Organizer and upload manually.
The last screen will show the reason.

Q: Provisioning Profile disappeared? Isn't it supposed to work automatically if you have a subscription?

Delete the %localappdata%\Temp\Xamarin\XMA folder and restart VS.

Q: Unable to upload to the store in macOS either, saying a new SDK is required?

Congratulations, you'll need to start from scratch—download the latest OS dmg from your current macOS, then convert it to an iso file directly in macOS. Don't use Windows's dmg2iso; I tried and it failed.
Don't download VMWARE IMG from the internet, as it's meant for people without macOS and has many bugs and performance issues. It can't be updated, so just download the official latest version.
Once the OS is sorted, download the latest XCode. Then update Visual Studio on Windows (VS version and XCode are interdependent; once upgraded, you can't downgrade, and you won't find detailed historical versions online).
Follow Microsoft's instructions to generate new Provisioning Profiles and Certificates. Manually download them in both VS and XCODE to see if they appear in the list. Restart macOS, restart VS, and delete the XMA folder.

Q: Can't delete %localappdata%\Temp\Xamarin\XMA, files are in use?

End the Broker and IOS tasks in Task Manager, or use Process Hacker 2 to search for XMA.

Q: iOS Release Build takes forever!?

Stay calm~ Wait for ten minutes. Debug builds are faster, which is normal, probably because ARM is slower than X86.

Q: Upload To Store shows empty Profile and Certificate

The Certificate generated by macOS is tied to the OS, so generate new Profiles and Certificates in the Apple Developer Account.
Download the new Profile in XCode settings and in Visual Studio settings.

Q: Authenticate Service not available.

A1: Too many frequent operations, Apple locked it for an hour.
A2: Check the Developer Account to see if new terms need to be accepted. Without acceptance, this message will appear.

Q: After generating a new Certificate in macOS, VS shows Not in keychain?

It means the Certificate is not in the macOS keychain, so download it from the Certificate creation page and import it into the Login keychain. Don't put it in System or iCloud.

Q: Even though it's in Login, the Certificate shows an error in red instead of Valid?

The Developer Relations Intermediate Certificate might have expired, so download it from https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer and import it. Then redo the Certificate generation steps.
Reference: https://developer.apple.com/forums/thread/662300

Q: Can connect to macOS, but Build, Archive, or Distribute shows cannot connect to macOS?

Delete the %localappdata%\Temp\Xamarin\XMA folder and restart VS and macOS.

Thoughts

Using Visual Studio on Windows connected to macOS on VMWare is a great combo for budget-conscious developers.
This year I convinced the company to buy an M1 Mac Mini 16G/512G 1G, and the build speed is much faster! The emulator opens instantly.
The downside is I can only use Visual Studio Community for Mac
since, unlike on Windows, Visual Studio Enterprise isn't readily available on the internet (?).