Share via


MapImage.Url Property

Contains a URL to access the map image, which is cached on a MapPoint Web Service server for a limited time. The URL uses either standard or secure hypertext protocol, depending on the MapOptions.ReturnType property setting. String.

Public Dim Url As String
    Member of [Namespace].MapImage
[C#]
public System.String Url
    Member of [Namespace].MapImage

Remarks

  • The returned URL does not include any information identifiable to a specific map or map request; it is simply a key into the MapPoint Web Service server cache. The URL is UTF-8 encoded.
  • A returned URL is valid for returning up to ten images within five minutes of the call to the GetMap method. After five minutes or ten images (whichever occurs first), accessing the URL returns a session time out message. For more information about working with URLs to cached map images, see Using MapPoint Web Service in a Web Application.
  • The .gif file sent in response to the HTTP or HTTPS request includes a MIME header indicating the MIME type and the name of the returned image. The MIME header matches the MimeData.MimeType and MimeData.ContentID properties of a map image returned directly from the RenderServiceSoap.GetMap method.
  • The Url property is null if the MapOptions.ReturnType property is set to ReturnImage (MapReturnType enumeration).

Example

 
[Visual Basic] 
'This example assumes that the service instance 
''renderService' has already been created and that 
'the MapPoint Web Service namespace has been imported 

'Return a URL to the map instead of the whole image
Dim myViews(0) As ViewByHeightWidth
myViews(0) = New ViewByHeightWidth()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).Height = 200
myViews(0).Width = 300

Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
mapSpec.Options = New MapOptions()
mapSpec.Options.ReturnType = MapReturnType.ReturnUrl

Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)

Image1.ImageUrl = mapImages(0).Url

 
[C#]
//This example assumes that the service instance 
//'renderService' has already been created and that 
//the MapPoint Web Service namespace has been imported 

//Return a URL to the map instead of the whole image
ViewByHeightWidth[] myViews = new ViewByHeightWidth[1];
myViews[0] = new ViewByHeightWidth();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].Height = 200;
myViews[0].Width = 300;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
mapSpec.Options = new MapOptions();
mapSpec.Options.ReturnType = MapReturnType.ReturnUrl;

MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);

Image1.ImageUrl = mapImages[0].Url;

 

See Also

MapImage Class | MapOptions.ReturnType Property | Using MapPoint Web Service in a Web Application | MimeData.MimeType Property | MimeData.ContentID Property | RenderServiceSoap.GetMap Method | MapReturnType Enumeration