mercoledì, maggio 28, 2008

Zoom url for virtual earth map

Using url api with virtual earth lets you create custom urls to show your maps.

Too bad that zoom parameter is ignored if you didn't specify the cp parameter (center point).

Urls for your collection, pushpin etc didn't specify the cp parameter so you cannot zoom as you prefer.

The only way I found around this, is to add the cp parameter and the zoom.

Getting the value for the cp isn't straightforward. The method I use is to leverage virtual earth interactive sdk.

Try the following procedure...

In virtual earth interactive sdk, center your map wherever you want.

Expand the "get map info" section on the "I want to" list to the left.

Choose "Get center LatLong".

Copy the latitude and longitude values from the textbox on the upper right corner.

You'll get something like "46.18800127814599, 10.01798629760741". Replace ", " (comma space) with ~ (tilde).

You''ll get "46.18800127814599~10.01798629760741"

This is the cp value.

Suppose that you want to create the url for your collection (say http://maps.live.com/?encType=1&cid=4A87B282CC09CC70!187).

Add cp with the value just found and the zoom parameter (lvl in the range 1-19).

I usually use aerial maps so I also add style=a.

The url is:

http://maps.live.com/?encType=1&cid=4A87B282CC09CC70!187&style=a&lvl=16&cp=46.18800127814599~10.01798629760741#

Nessun commento: