Siege

MFS2020 Use Third-Party Map

Background

Microsoft Flight Simulator 2020 uses Bing’s satellite map imagery. However, the satellite maps are relatively old and many areas aren’t covered by Bing. This issue occurs in different regions of the world. The Bing imagery on the mainland is from 10 years ago. There are a large number of regions where satellite images are not available. Microsoft uses the program-generated maps instead to fill in the missing areas, and the quality of these generated maps is very poor compared to acctual satelite imagery. However, after enabling the Google Maps replacer the image quality and details have been significantly improved, as shown in the images below.

Original Map

Original map

By replacing the imagery with Google Maps’ data you get much higer quality scenery

A Small Town Using Bing Maps

A small town

A Small Town Using Google Maps

A small town

Qinghai Lake (These satellite images do not exist using Bing’s data)

Qinghai Lake Qinghai Lake Qinghai Lake

Chengdu

Chengdu

Hong Kong

Hong Kong

I have been studying the possibility of replacing it with Google Maps for a long time and there are also YouTubers on the Internet who have provided some ideas such as using a crawler to get the data from Google and import it into MSFS2020 but this method is more complicated and cannot be used on a large scale.

Later, I studied the network request and found that MSFS downloads it’s imagery from Bings’ servers. Which meant in theory, it should be possible to replace the pictures with other pictures. As it happens the slicing method of bing and google’s satellite images is similar and can be seamlessly switched and Microsoft also provides the converted source code (see this function QuadKeyToTileXY)

In the process of constant searching, I found examples similar to my thinking but his main purpose was to remove some unnecessary things to improve the quality of the landscapes. He also built an additional warehouse to demonstrate a method of using proxys to replace the landscapes. Unfortunately, this warehouse lacks some necessary things and cannot operate normally.

IMG


In Mainland China, access to maps.google.com is blocked.

I find a way to access Google Map satellite tile picture file, avoid use local proxy.

Connect the Google Maps API through Cloudflare Worker, use Cloudflare Works service as reverse proxy.

0. Apply a Cloudflare account

1. Add new Workers script

1.1 Go to Workers page

navi

1.2 Click ‘Create a Service’

neww

1.3 Taking names and selecting options

w1

2. Edit worker rules

w3

addEventListener(
	"fetch",event => {
		let url=new URL(event.request.url);
		url.hostname="khm.google.com";
		let request=new Request(url,event.request);
		event. respondWith(
			fetch(request)
		)
	}
)

Copy and Paste, and click ‘Save and Deploy’

3. Test connection

Google origin tiles URL:

https://khm.google.com/kh/v=908?x=1674&y=895&z=11

Workers tiles URL:

https://googlemap.level5.workers.dev/kh/v=908?x=1674&y=895&z=11


4. Use your domain (OPTIONAL)

dns dns2 dns3

https://gmap.via.moe/kh/v=908?x=1674&y=895&z=11


This version is currently discontinued by the original author and I have now added mapbox and arcgis api support to this version.

If you are interested you can follow this repo.

https://github.com/h0wardch3ng/msfs2020-google-map

Original quotation

https://github.com/derekhe/msfs2020-google-map