How to use Google Map/Yahoo Map/Bing Map as the basemap in MapGuide Fusion viewer?

Source: Internet
Author: User
Document directory

MapGuide 2009 began to provide a Flexible network layout Flexible WebLayout, also known as Fusion Viewer. MapGuide Fusion Viewer is based on the <Div> + CSS layout mode, so the layout is more flexible. MapGuide provides five templates. In addition, you can also define your own templates and use CSS to control Fusion display styles. Fusion Viewer uses a subset of OpenLayers. In addition to the Fusion Viewer API, OpenLayers APIs can also be applied to MapGuide development.

Since MapGuide Fusion Viewer is built on the basis of OpenLayers, You can naturally use the OpenLayer function. The most attractive thing is to use Google Map as the basemap of MapGuide. In MapGuide2010, we need to integrate Google Map by ourselves. Jun Qilian also wrote related methods in his previous articles. This feature has been added to the product in MapGuide Enterprise 2011, making it easier. Next, let's take a look at how MapGuide Studio 2011 uses Google Map, Yahoo Map, and Bing Map as the basemap.

 

In MapGuide Studio 2011, we create a Flexible Weblayout. On the Map tab, we first specify the map resource of the MapGuide used, and set the initial view. These are not changed in the previous version. Here, the map resource I selected is Sheboygon3785. of course, this map is not a normal map. Here, I will press "no table", and I will talk about it later.

 

Next we will add the basemap. If you are using Google map or Yahoo map, you need to apply for an API key. For example, if I use localhost to apply for the domain name, the API Key is token. Select the Map type to be added, such as the Street of Google Map. Enter the Google Map API key and save it. Yahoo Map is similar to Google Map.

Bing Map is easier to use. You don't need to apply for an API key. You just need to hook it up. If you select multiple map types, you can also use that as the default basemap, that is, the basemap used when the map is added for the first time.

 

Okay. Now you can save Weblayout and preview it in the browser. Google Map should be displayed successfully. If the original MapGuide Map resource is incorrect, you may find that the MapGuide layers and Google Map maps cannot be combined. What is the problem?

 

Here, we need to briefly talk about the coordinate system. The coordinate system used by Google Map, Yahoo Map, and Bing Map is not the standard WGS84, but the earth is regarded as a positive sphere (in fact, the elliptical body, the direction of the equator is a little longer than the two poles ), the EPSG3785 coordinate system is used. Of course, there may be a slight loss in accuracy. For Google Map and other such applications, the accuracy should be enough. If your MapGuide Map and Google Map are perfectly integrated, the MapGuide Map must also use the same coordinate system as Google Map. We need to go back to MapGuide Studio and open map to edit its coordinate system. We need to select the wgs84.pseudo domercator coordinate system, which can be found in the World/Continental directory of MapGuide Studio.

 

After selecting the correct coordinate system, we can go back to the browser and check that the MapGuide Map can be integrated with Google Map \ Bing Map. However, there seems to be another problem, that is, the surface layer color in my MapGuide is set to fill the color, and he will block the Google Map below. What should I do? In fact, you can edit the style of the layer to change the transparency of the fill color.

 

Now, we have Google Map, Yahoo Map, or Bing Map as the basemap, and can switch the Map through the Extenal Providers menu.

 

 

Come here today. You can try it.

 

Cheers,

Junqilian

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.