Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Virtual Earth Web Service - Retrieve Image

This is a discussion on Virtual Earth Web Service - Retrieve Image within the Bing Maps and MapPoint Web Service forums, part of the Map Forums category; Hello All, I'm attempting to use the new VEWS version 1.0 to retrieve a static image via the imagery service. ...

  1. #1
    ve_greg is offline Junior Member White Belt
    Join Date
    Oct 2008
    Posts
    2

    Virtual Earth Web Service - Retrieve Image

    Hello All,

    I'm attempting to use the new VEWS version 1.0 to retrieve a static image via the imagery service. I'm using VS 2008 / VB.

    On the .GetMapUri call, I get this error message back:
    "The argument value must be between 80 and 900. Parameter name: Options.ImageSize.Width Actual value was 0."

    I've attempted to pass the control's dimensions and also hard-coded the size values (both well within the stated limits) but regardless, it is returning this error message.

    My credentials are fine, as I can geocode for instance. However, I'm stuck on attempting to pull a static map back using the service. Any advice from anyone? (source code below)...

    Thanks in advance,
    -Greg


    Dim mapUriRequest AsNew VEWS_Staging_ImageryService.MapUriRequest
    'Set credentials using a valid Virtual Earth Token
    mapUriRequest.Credentials = New VEWS_Staging_ImageryService.Credentials
    mapUriRequest.Credentials.Token = sToken
    'Set the location of the requested image
    mapUriRequest.Center = New VEWS_Staging_ImageryService.Location
    mapUriRequest.Center.Latitude = AddressToDisplay.YCoord_Latitude
    mapUriRequest.Center.Longitude = AddressToDisplay.XCoord_Longitude
    'Set the map style and zoom level
    Dim mapUriOptions AsNew VEWS_Staging_ImageryService.MapUriOptions
    mapUriOptions.Style = VEWS_Staging_ImageryService.MapStyle.AerialWithLab els
    mapUriOptions.ZoomLevel = 10
    'Set the size of the requested image to match the size of the image control
    mapUriOptions.ImageSize = New VEWS_Staging_ImageryService.SizeOfint
    mapUriOptions.ImageSize.Width = 200
    mapUriOptions.ImageSize.Height = 200
    mapUriRequest.Options = mapUriOptions
    Dim imageryService = New VEWS_Staging_ImageryService.ImageryService
    'Make the image request
    Dim mapUriResponse As VEWS_Staging_ImageryService.MapUriResponse
    mapUriResponse = imageryService.GetMapUri(mapUriRequest)
    PictureBox1.ImageLocation = mapUriResponse.Uri.ToString

  2. #2
    langleyworld is offline Junior Member White Belt
    Join Date
    Jun 2005
    Posts
    3

    Re: Virtual Earth Web Service - Retrieve Image

    Greg,

    When I generated the VEWS proxy (C#) I noticed that there were 2 additional properties that I needed to set to get it working.

    mapUriOptions.ImageSize.HeightSpecified = true;
    mapUriOptions.ImageSize.WidthSpecified = true;

    Best Regards,

    Dave

    David Langley

    SpatialPoint, LLC.
    1000 Executive Way
    Des Plaines, IL 60018

    Virtual Earth | MapPoint | Locator Experts | SpatialPoint

  3. #3
    ve_greg is offline Junior Member White Belt
    Join Date
    Oct 2008
    Posts
    2

    Re: Virtual Earth Web Service - Retrieve Image

    Thanks for the reply. That worked great and I'm very appreciative.

    I'm not certain why the MS code examples don't utilize this (yet still work), but regardless it's working as expected now. Thanks again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting a Map with the Virtual Earth Web Service
    By VirtualEarth MSDN Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-26-2008, 07:22 PM
  2. Lancement de Virtual Earth Web Service et du Virtual Earth Map Control 6.2
    By Virtual Earth Europe in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-25-2008, 04:22 AM
  3. Announcing The Virtual Earth Web Service and Virtual Earth Map Control 6.2
    By VirtualEarth MSDN Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 09-25-2008, 01:21 AM
  4. Virtual Earth Image Updates in July 2008
    By VE For Government in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 07-23-2008, 03:51 PM
  5. January Virtual Earth Image Updates
    By VE For Government in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 01-29-2008, 02:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127