Monday, November 10, 2008

mScapes Workshop


This workshop was one I'd been anticipating, it was our first chance to design programs in mScapes, the project that emerged from the Mobile Bristol platform.  This program is Windows only and works on Windows Mobile devices.

Overall the program is quite powerful and scalable.  The trickiest part of the whole procedure is getting your own custom map into mScapes from something like Open Street Map, or an artfully hand drawn map, so you aren't stealing maps off Google.  So that's the part I will outline here.

When you've decided on a map to use in Windows, we'll use Open Street Maps for our example, we'll need a map saved as a .jpg or .gif.  Before we get there we will need to write some stuff down.  When you "Export" the map you've zoomed into you will see some numbers below "Area to Export".  You can either manually draw an oddly shaped map or go with the square map.  The numbers that indicate the top, bottom, left, and right of the map.  Be sure to record those clearly and in the right order.  Otherwise things will be confusing later.

Open Street Map saves as a .jpg but unfortunately you'll notice it may muck up the colours if you import directly into mScapes.  Convert it to .gif with a graphic converter program then we'll import it into mScapes.  

Once you've installed mScapes (you'll notice it'll also install the .NET framework once you run the installer), create yourself a project file so you can keep all your files in the same place, it'll get a little messy otherwise.  Open the application and create a new mScape.  Save the new mScape and you'll get a dialogue asking for a LOT of descriptive information.  Don't make the mistake I did, fill in the first field (title) because it won't give it a default name like "untitled" and you'll end up with an unlabeled file (potentially annoying).

Go to the Tools menu> then Import Map from Image.  You can select your freshly converted .gif and it will create a maplib file.  It prompts you to enter your coordniates you can do so now according to the coordinates you recorded from Open Street Maps.  Notice how it will ask for the Latitude and Longitude of each corner.  The coordinates you've recorded from Open Street Maps will be the Top, Right, Left, and Bottom lines of the box you've chosen.  Thankfully mScapes only asks for 3 of the four corners to be entered.  So the fields will be:
Top/Left:
(x) Longitude = left;
(y) Latitude = top;
Top/Right:
(x) Longitude = right;
(y) Latitude = top;
Bottom/Left:
(x) Longitude = left;
(y) Latitude = Bottom;
Bottom/Right:
(x) Longitude = right;
(y) Latitude = bottom;

Whew! Hope I got that right.  You'll know you've done it right if a Map located in North America has negative (x) Longitude values, indicating it's located in the Western Hemisphere.

After all of that, your map won't instantly appear in the window, you have to manually Add Map, and choose the newly created maplib.  I can't recall how to import a map and I'm blogging this without the program infront of me, but just to be aware if you choose at any point not to enter the coordinates in the first step, you reimport the map and will be given the option to change the coordinates of an existing map.  I'll clarify this post at a later time with more detailed instructions.  If I have the opportunity I'll create something within mScapes before I leave Banff so I'll know the program a bit better.

1 comment:

Sweety said...

Nice post AR... thanks for sharing your experience... enjoyed reading your blog..

Regards,
Jane
iPhone Application Development