‘Bing’ oh! – ArcGIS, Flex, WMS and Bing
Last night I was struggling to overlay a set of WMS layers on top of Bing Maps and was driven to the point of frustration. The layers simply did not overlay. It always took me to a point on the sea near Africa which meant that the Coordinate Systems did not match. It takes you to the center of the earth (Latitude: 0.oo, Longitude:0.00) if you have layers in different SRS. Could not find any solution in the blogs as well as the ArcGIS Flex API resource center. Maybe because it is a pretty new feature released a few months back in API Version 1.2.
After some research found out that Bing Maps serves their tiles using EPSG 102113 whereas the other services are in EPSG 4326 which is the standard. EPSG 102113 is the same as EPSG 900913 used by Google Map tiles.
So to overlay, you will have to reproject your layers in EPSG 4326 to EPSG 102113. This is how you do it in Flex API.
In your Extent definition:
In your Query and GeoProcessor definitions, add
The WMS looked like this:
Everything set, I fired up the application only to find that the WMS layers failed!.
The WMS layers are being served from Geoserver and Geoserver does not seem to recognize EPSG 102113. So to get it working I tried changing the SRS of the query from 102113 to 900913. So the new code looked like this:
Bing’o! All my WMS layers are now overlaid properly on Bing Maps.
I’ll have to try overlaying the ArcGIS Online Mapserver services on this now! That should be a cakewalk. But you never know.