Category Archives: Windows Phone 7

Who is suing whom ?

Who is suing whom

Who is suing whom in mobile world


Windows Phone 7 and WMS test

   I have quickly tested my new Windows Phone 7 (Samsung Omnia) device with the Czech cadastral map WMS overlay over the BingMaps and DeepEarth (also see this blog here: http://blog.sumbera.com/2010/11/10/wms-overlay-on-bing-maps-vs-deepearth-on-wp7/) . if you are familiar with www.ikatastr.cz and iPhone version of it (iKatastr) than this example is using same data sources.

In short : it was a great experience – WP7 was smoothly  registered, automaticaly connected to internet even without  a SIM card using USB cable and Visual Studio 2010 integration just works perfect (so far:) In comparison to many difficulties and ‘certification hell’ on iPhone this is a great relief. Now giving the fact that Nokia is going to support and develop Windows Phone 7, great user experience with WP7 and (for me and menay others) great development experience, this might change the mobile landscape significantly over the 1 or 2 years.

I will guess here that WP7 platform will exceed number of iPhone applications in less than 2 years.


WMS overlay on Bing Maps vs. DeepEarth on WP7

2 comparisions videos of runing Bing maps and DeepEarth with tiled WMS overlay.

BING MAPS:

DEEP EARTH:


Tiled WMS overlay in Windows Phone 7

  This post [http://blog.sumbera.com/2010/02/25/overlay-wms-on- google-in-silverlight-bing/ ] talked about how to overlay over the Bing maps Silverlight control Google tiles  and tiled WMS. It was quite easy to port this web sample into the Windows Phone 7 emulator. I took a smaple code from Training kit called “Ex1-TheBingMapControl” and extend it with the 2 classes : GoogleTile and WmsTile, with slight changes to the namespace using Microsoft.Phone.Controls.Maps (original for Silverlight was  Microsoft.Maps.MapControl). Then extend MainPage.XAML with :

                    <my:MapTileLayer Opacity=”1″>
                        <my:MapTileLayer.TileSources>
                            <local:GoogleTile></local:GoogleTile>
                        </my:MapTileLayer.TileSources>
                    </my:MapTileLayer>
                    <my:MapTileLayer Opacity=”1″>
                        <my:MapTileLayer.TileSources>
                            <local:WMSTiledOverlay></local:WMSTiledOverlay>
                        </my:MapTileLayer.TileSources>
                    </my:MapTileLayer>
 
 

Extended sample code availabel for download here : http://www.sumbera.com/lab/wp7/TheBingMapControlWithWMSandGoogle.zip

 Update: I found the way calculating BoundingBox from the quadkey somehow limiting (the DeepEarth weay) since it worked only till the level 18. So here is updated class fro getting correct bounding box of the tiled WMS request in the Bing Silverlight control:

            public static double TileToWorldPosX(double tile_x, int zoom) {
                return  (float)((tile_x / Math.Pow(2.0, zoom) * 360.0) – 180.0);
            }
            public static double TileToWorldPosY( double tile_y, int zoom) {
                double n = Math.PI – ((2.0 * Math.PI * tile_y) / Math.Pow(2.0, zoom));
                return   (float)(180.0 / Math.PI * Math.Atan(Math.Sinh(n)));
            }
            public override Uri GetUri(int tilePositionX, int tilePositionY, int tileLevel) {
                int zoom = tileLevel; //SSU tileLevel would be same as zoom in Bing control
                double deltaX = 0;// 0.00135; //SSU deltaX for SLP WMS
                double deltaY = 0;// 0.00058; //SSU deltaY for SLP WMS
                double minXLon = TileToWorldPosX(tilePositionX, zoom) + deltaX;
                double minYLat = TileToWorldPosY(tilePositionY + 1, zoom) + deltaY;
                double maxXLon = TileToWorldPosX(tilePositionX + 1, zoom) + deltaX;
                double maxYLat = TileToWorldPosY(tilePositionY, zoom) + deltaY;
                string wmsUrl = string.Format(this.UriFormat, minXLon, minYLat, maxXLon, maxYLat, 256);
                return new Uri(wmsUrl);
            }
        
        }
   

 


Follow

Get every new post delivered to your Inbox.