spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2009
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2009

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Travel Insurance Compare over 450 travel insurance policies (inc. annual multi-trip, single trip & winter sports)

  ARTICLES  


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)mp2kmag.com
URL: http://www.mp2kmag.com
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.



Google
 
MP2Kmag Internet


 Recent Discussion
-Bing Maps Book in French
-Oval adjustments access denied
-bingmaps: RT @BingMapsDev: Great new book in French on Bing Maps from @NicolasBoonaert http://bit.ly/ba72nc
-Bing Maps Powers The National Grid
-New Bing Maps Book Helps Developers
-bingmaps: Visit #bingmaps explore site http://bit.ly/cjMOBf and hit map apps to get a different view of the Vancouver winter Olympics
-Help with Spatial Data/Table. Sql add-in Mappoint
-Matching by Zip Code
-Another Big Imagery Release for Bing Maps
-BingMapsDev: @csharpzealot and the 2.3GB download begins ;)
-BingMapsDev: Great new book in French on Bing Maps from @NicolasBoonaert http://bit.ly/ba72nc
-bingmaps: MapDotNet's entry to Azure US State and Local Government Application Development Contest with Bing Maps: http://miami311.cloudapp.net/
-Ability to change color of state lines?
-bingmaps: @chrispendleton on stage right now at TechDays in Paris. Presenting #BingMaps
-route directions????
-bingmaps: Interested in the rare trees of London? View them in this #BingMaps collection http://bit.ly/chOLp9
-MapPoint in Desktop Applications
-Varying travelling time by "time of day"
-Link using parameter query in Access, still no?
-Can I see a list of all pushpins?
-Assigning pushpins as territories
-Displaying info in the directions for a route
-Drive time polygons - help needed
-2002 Loading Help
-bingmaps: Webcast 10th Feb: #BingMaps ? Getting Started for Developers. Presented by @johanneskebeck http://bit.ly/8XhzCC
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia Custom Home


Want Your Site To Appear Here?

   © 1999-2009 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009 are either trademarks or registered trademarks of Microsoft.

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner Cartridges at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards • The Search Starts Here Used Cars
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars UK, Car Lease and Contract Hire