Category Archives: WMS

iKatastr rocks !

This is somehow very encouraging

#1 iKatastr is still on top in the category Navigation in Czech app store after 4 months ! on iPhone it keeps 2nd place right after Mapy CZ provided by largest internet search in CZ Seznam.  On iPad, however, iKatastr is still 1st in category Navigation.

#2 Users of iKatastr has reported quite lot positive feedbacks, see here : http://appcomments.com/app/id396352287/iKatastr_reviews?country=143489&show=show_all_comments&sort=sort_recent&sortorder=sort_ascend&page=1

#3 IKatastr has been mentioned in Czech magazine “Mobility” 1/2011, on page 85.

Quoted from the magazine press:

“There are just few  high quality applications in the Czech App Store. Even fewer of them are for free.
 iKatastr developed at Mendel University in Brno belongs to this narrow group with functionality that is also unique in the international comparison. “

 

OpenLayers or GoogleMap v3 for mobile web app ?

[2014 January] UPDATE : new Openlayers 3 beta 1 works quite well on iPad as well as Laeflet 0.7, check post here http://blog.sumbera.com/2014/01/23/leaflet-0-7-vs-openlayers-3-beta-1-on-ios/

[2011 September] UPDATE : new Openlayers 2.11 works quite well on iPad/iPhone.

I have experimented with OpenLayers 2.9 using touch.js extension for capturing touch events from iPhone/iPad. Although stripped down version of OL is about 184KB, the performance is very bad. If you have iPhone/iPad check this experiment: http://www.sumbera.com/lab/iPhone/katastr.htm (note it will not work from desktop browser)

OL team is working on v3 of OL to be more lighter, faster even for mobile devices, see here: http://trac.osgeo.org/openlayers/wiki/three  or here : http://openlayers.org/blog/2010/06/30/openlayers-3-on-github/

Meanwhile I have tested new GoogleMaps v3 how it works on iPhone/iPad. despite few problems (stability, problems with cached tiles or disconnected JavaScirpt  to load new tiles -iPad)  it works pretty well . Check yourself this page from your mobile touch device (iPhone.iPad,Android): https://ikatastr.cz

Conclusion : Google Maps v3 wins on mobile over the Openlayers 2.9

 

Tiled WMS overlay in Windows Phone 7

Update 13/03/2013, here is new  blog about Tiled WMS overlay for Windows Phone 8 :http://blog.sumbera.com/2013/03/10/tiled-wms-overlay-in-windows-phone-8/

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 WMSTiledOverlay()
: base(@"http://mapserver-slp.mendelu.cz/cgi-bin/mapserv?map=/var/local/slp/krtinyWMS.map&REQUEST=GetMap&SERVICE=wms&VERSION=1.1.1&SRS=EPSG:4326&WIDTH={4}&HEIGHT={4}&FORMAT=image/png&BBOX={0},{1},{2},{3}&LAYERS=hm2003&Transparent=true"){}
            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);
}}
   

MapRip bookmarklet that saves map context

I was trying recently to utilize bookmarklets for injection of custom code into arbitrary webpage to get control a provide some additional funcitonality.. for example transfering the content of openlayers maps into MapShake. Not heard about MapShake ? I will post soon more. My bookmarlet looks like this:

javascript:(function(){var%20s=document.createElement(%22script%22);s.charset=%22UTF-8%22;s.src=%22http://www.sumbera.com/lab/MapRip/MapRip.js%22;document.body.appendChild (s)})();

try{
var rippedMap = map;
var format = new OpenLayers.Format.WMC({‘layerOptions’: {buffer: 0}});
var text = format.write(rippedMap);
var w;
setTimeout(‘w=window.open(“”,””,”width=600,height=1200,resizable=0,scrollbars=1″);e(w);’,10);
function e(w){
d = w.document;
d.write(“<textarea id=’wmc’ rows=’100′ cols=’65’>” + text +”</textarea>”);
d.close();
w.focus()
}

page with bookmarklet

MapRip bookmarklet that saves map context

I was trying recently to utilize bookmarklets for injection of custom code into arbitrary webpage to get control a provide some additional funcitonality.. for example transfering the content of openlayers maps into MapShake. Not heard about MapShake ? I will post soon more. My bookmarlet looks like this:

javascript:(function(){var%20s=document.createElement(%22script%22);s.charset=%22UTF-8%22;s.src=%22http://www.sumbera.com/lab/MapRip/MapRip.js%22;document.body.appendChild (s)})();

try{
var rippedMap = map;
var format = new OpenLayers.Format.WMC({‘layerOptions’: {buffer: 0}});
var text = format.write(rippedMap);
var w;
setTimeout(‘w=window.open(“”,””,”width=600,height=1200,resizable=0,scrollbars=1″);e(w);’,10);
function e(w){
d = w.document;
d.write(“<textarea id=’wmc’ rows=’100′ cols=’65’>” + text +”</textarea>”);
d.close();
w.focus()
}

page with bookmarklet