MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Change Virtual Earth Background Color

This is a discussion on Change Virtual Earth Background Color within the Virtual Earth Blogs forums, part of the Blogs category; I recently got pinged about how to change the background color of the DIV element for a Virtual Earth map. ...


Go Back   MapPoint Forums > Blogs > Virtual Earth Blogs

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-09-2008
Senior Member
Blue Belt
 
Join Date: Sep 2007
Posts: 202
Change Virtual Earth Background Color

I recently got pinged about how to change the background color of the DIV element for a Virtual Earth map. Virtual Earth's CSS elements aren't documented (at least not officially), so perhaps this helps those who need/want this changed.

So, the typical scenario for loading a map is to call LoadMap() and by zooming all the way out you can see the map control's tan color behind the tiles (#E9E7D4).

image

The following code will render your basic Virtual Earth map. We'll use this to illustrate the necessary changes to make in order to modify the background color.



Change Map BG Color








  

The specific request came up because Virtual Earth doesn't "wrap around." Meaning, if you pan east or west you can't get back to where you started. You hit an edge (the end of the map control tiles) and have to go back the opposite direction. Certainly not ideal, so, if you have an application with points that span both the eastern and western half of the Pacific Ocean you may end up seeing the map zoomed out completely. Well, the tan doesn't look so great, so we can change the color to match the oceans - #B3C6D4.

image

So pretty!

Eh-hem. Ah, so, what are the code changes? You'll want to use onLoadMap property so when the map loads the color will be there and you'll want to attach an onchangeview event to the map control so the color remains the same when the map view changes. Differences from the above code are highlighted in red below. 



Change Map BG Color








  

I simply had to override the CSS for the DIV element. You can also attach other events like onchangemapstyle for when users switch to aerial view to change the background to the cool dark blue (#020514) or any RGB color.

 image

CP



Click here to view the article.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/change-virtual-earth-background-color-8020.html

Posted By For Type Date
The Magazine for MapPoint - MP2K Magazine This thread Refback 07-10-2008 02:45 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Change color of arrow Shragel MapPoint 2006/2009 Discussion 3 07-12-2006 07:28 PM
Change Background Color of Map wadams MapPoint 2006/2009 Discussion 3 06-05-2006 09:34 AM
Change color of Text Balloon Anonymous MapPoint 2006/2009 Discussion 2 05-17-2004 07:26 AM
Can one say me how to change color of DataMap to white!! Anonymous MapPoint 2006/2009 Discussion 0 04-09-2003 10:15 AM
Can I change the color of the over-all map? We wa.... Anonymous MapPoint 2006/2009 Discussion 1 08-29-2000 12:56 PM


All times are GMT -5. The time now is 11:02 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Ski Holidays Austria
Ski holidays in Austria offer ski schools for all types of skiers. They range from beginner classes of all ages to more advanced classes. Learn new techniques and refresh skills.

European City Breaks
Book European city breaks with Travel Counsellors. A personal travel counselor will help plan your European city break.

Cheap Holidays to Cuba
Cheap holidays to Cuba are a reality when you book with dealchecker.co.uk. We search leading UK Travel agents and tour operators to bring you some great deals.

Dominican Republic Holidays
Dominican Republic holidays have something to offer for everyone. From water sports, to sun bathing and more, enjoy a holiday there!

Spain
Spain is such a diverse country that it has something to offer most holidaymakers. Finding delicious cuisine is no challenge and the shopping ranges from designer boutiques to unknown flea markets. Spain has much to offer.

Travel
Check out the travel options on Travel.co.uk.

Cheap Gran Canaria Holidays
Want to take a break and visit the Canary Islands? Get information on cheap Gran Canaria holidays at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51