MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Virtual Earth API: Adding KML or GeoRSS Layers to the Map

This is a discussion on Virtual Earth API: Adding KML or GeoRSS Layers to the Map within the Virtual Earth Blogs forums, part of the Blogs category; One of the new features of the Virtual Earth v6 Map Control API is the ability to import KML layers ...


Go Back   MapPoint Forums > Blogs > Virtual Earth Blogs

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-04-2008
Junior Member
Yellow Belt
 
Join Date: Jan 2008
Posts: 25
Virtual Earth API: Adding KML or GeoRSS Layers to the Map

One of the new features of the Virtual Earth v6 Map Control API is the ability to import KML layers on the map.  Previous versions of the API allowed you to import GeoRSS using client-side XML parsing.  However, one of the restrictions was that the GeoRSS file had to be on the same domain as the application or the browser would bring up a security warning unless the feed was from a trusted site in the client browser. 


For v6, we have improved this by added a new VEDataType.ImportXML option to the ImportShapeLayerData call on VEMap.  This new call uses the same service from Live Search Maps which allows users to import KML, GeoRSS, or GPX into user collections. In the Virtual Earth API, it will import the XML into a shape layer in your application.  It also allows you to load these data files from different domains without causing a browser security warning.


Here are the steps for importing a KML, GeoRSS, or GPX file into your Virtual Earth application:



  1. Create a shape layer


var shapeLayer = new VEShapeLayer();


   2. Create a shape source specification with type VEDataType.ImportXML, the url to the XML file, and a reference to the shape layer:



var shapeSpec = new VEShapeSourceSpecification(VEDataType.ImportXML,"http://dsc.discovery.com/utilities/googleearth/nationalparks/nationalparks.kml", shapeLayer);


   3. Import the data into shape layer by calling ImportShapeLayerData on the map with the specification:



map.ImportShapeLayerData(shapeSpec);


Here's a link to a simple example which imports a KML file from the Discovery Channel that shows different national parks around the United States:



Virtual Earth API - Import XML Sample



Note: you can also import XML files directly into Live Search Maps by opening a collection and then clicking on Import and entering the url.  You can also, use the following url syntax directly:



http://maps.live.com/?mapurl=[insert url here]


For example:



http://maps.live.com/?mapurl=http://dsc.discovery.com/utilities/googleearth/nationalparks/nationalparks.kml




More...
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

Tags
adding, api, georss, kml, layers, map, virtual earth


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
BRIGHTi GeoFeeder for converting Geodata to GeoRSS VE Team Virtual Earth Blogs 1 08-19-2008 02:07 PM
Mashing KML and GeoRSS in 3D on the Web VE Team Virtual Earth Blogs 0 10-26-2007 01:13 PM
Virtual Earth News from GEOINT 2007: Virtual Earth Appliance VE For Government Virtual Earth Blogs 0 10-24-2007 12:10 PM
GeoFeeder: Convert Your Vector Data to GeoRSS and Import into Virtual Earth VE For Government Virtual Earth Blogs 0 10-17-2007 09:41 AM
Adding other layers to mappoint street maps Anonymous MapPoint Web Service and Virtual Earth 0 05-12-2005 07:42 PM


All times are GMT -5. The time now is 01:17 PM.


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 Resorts
Choose from the comprehensive range of ski resorts at Holiday Hypermarket. Search for ski holidays online at Holiday Hypermarket to find ski holidays that are right for you.

Flights to Italy
Find cheap flights to Italy on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Italy.

Cape Town Cheap Flights
Thinking about visiting Cape Town. Cheap flights are hard to find unless you visit dealchecker.co.uk. We'll shop around so you don't have to.

Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!

Morocco
Gain insight on your holiday destination with the ULookUBook travel guides. Find out about Morocco and its customs online. Make an informed decision when you make a booking.

Compare holiday prices
Compare holiday prices online where you can see all the possibilities at Travel.co.uk

Cheap Lanzarote Holidays
The Canary Islands beckons you to come! View information on cheap Lanzarote 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 52