spacer2 1_1 1_2
 The MP2K Update!
Front Cover
What's New
Sample Data
MapPoint 2013
Press Releases
MapPoint Forums
Link to MP2Kmag
Wish List
MapPoint Trial
 Earlier Content
Past News Items
Past What's New Announcements

MapPoint 2013

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials

Map Visitors


Creating a Grid Over Iraq In MapPoint

MP2Kmag shares some grid creation code centered over Iraq based on a suggestion and coordinates from Mike Mueller, a Wisconsin fire-fighter and MapPoint programmer

Creating a Grid Over Iraq In MapPoint MP2Kmag shares some grid creation code centered over Iraq based on a suggestion and coordinates from Mike Mueller, a Wisconsin fire-fighter and MapPoint developer Mike Mueller developed this spreadsheet and as a MP2K Magazine reader, suggested that others might be interested in seeing a map and grid developed to show events and the extent of the Iraq War in MapPoint.

Anyway, translating the coordinates into a script was fairly straightforward, so I'll mostly let the code speak for itself but will also share a couple early "mis-fires".

If you're familiar with Visual Basic, this subroutine can simply be called from say a form_load or button click event, or anywhere it's appropriate in your application.

Here is the code.

As you can see, the subroutine declares variables, sets initial values to them and loops and performs MapPoint methods. A couple notes: when I first ran this, I set the line weight to 1, assuming that would be the smallest line size, but for whatever reason that came out to the second line weight in the interface. I changed this to 0.1 and re-ran - and now it is the smallest line weight. I don't have an explanation, just thought I would point this out. Also, note the geoSendBehindRoads, this is necessary for the grid not to overlay the entire area and let the underlying cartographic data show on top.

I am the type of developer who likes to write some lines and then run it and let the results dictate the necessary logic for completion of the task, so the first passes I will share are not surprising..

In this first map, I had reversed the x and y coordinates (needed to read the documentation more carefully), and hadn't yet included a fifth location object (objLoc) necessary to complete the drawing of a square.

(click on the image to view the entire map)

One reader's comment -- "That is not a failure- it is the truth. Turkey's government is divided in how/ if they will allow us to use air space etc. and you show it as divided. The drawn image to me signifies a rip saw, and their loyalties are being ripped apart."

In this second map, I was almost there, but forgot to reset the y coordinate in the outer loop.

(click on the image to view the entire map)

Here is the final map.

(click on the image to view the entire map)

In our special area providing on-going coverage of the iraq war map, Mike Mueller has made some additional improvements to the code and there is an executable which you can downloaded and run if you are not a Visual Basic developer. By the way, we would be interested in seeing ports of the grid creation code to other development platforms. If you want to tackle this in say Delphi, Foxpro, C#, or any other language, please share in the discussion forum.

Sergey Berezniker submitted this code which is a translation to VFP - VFP Code Post.

Discuss this story in the forum.

Author: Eric Frost
Email: website(AT)
Eric is Editor and Publisher of MP2K Magazine and is a part-time student in University of Chicago's evening MBA program. Eric recently finished the MP2Kmag Guide What's New in MapPoint 2004.

MP2Kmag Internet

 Recent Discussion
-GCPowerStation v17.2
-GCPowerStation v17.2
-Gaussian 09W v8.0 Rev B.01 SMP
-Gaussian 09 E.01 Linux64
-Atmel Studio v.7.0.1931
-Steinberg Cubase Elements v9.5.40 WiN
-Nero Platinum 2019 Suite 20.0.05900 Multilingual
-Serif DrawPlus X8
-PROMT Master 19 Final + PROMT 19 Dictionary Collection
-Apple Logic Pro X v.10.4.2 Multilanguage (MacOSX)
-PROMT Expert 19 Final + PROMT 19 Dictionary Collection
-Waves Complete v2018.10.16 WiN by R2R
-VMware Fusion Pro 10.1.1 MacOSX
-Foxit Phantompdf Business v. Multilanguage
-Bluestacks v4.31.56.2510 Multilingual
-Xara Web Designer Premium (x64) Portable
-Adobe Bridge CC Update 3 by m0nkrus
-Garmin MapSource v5.4
-Alien Skin Exposure X4 Bundle | macOS
-Unity Asset Cubebrush - Scrap City Assets 1.0 x64
-Magix Samplitude Pro X3 Suite v. Multilanguage
-Waves Complete v2018.10.16
-Oxygen XML Editor 18.0 (Win/Mac/Lnx)
-Steinberg Cubase Elements v9.5.40 WiN
-The Foundry Nuke Studio 11.2v4 Win x64
Browse GIS books and periodicals
Find a MapPoint Partner or Consultant
Real Estate Thornbrook Subdivision

Want Your Site To Appear Here?

   © 1999-2012 MP2K. Questions and comments to:
  Microsoft and MapPoint 2002/2004/2006/2009/2010/2011/2013 are either trademarks or registered trademarks of Microsoft.