Discussion:
display a mapRepresentations in a desktop application
(too old to reply)
Antonio
2008-09-03 16:59:00 UTC
Permalink
How I can display a mapRepresentations in a desktop application (developed
by Visual studio 2008 VB)?

Thanks.

Antonio
I***@nospam.nospam
2008-09-04 17:03:50 UTC
Permalink
You would have to write your own map control.

Basically you load image from MapPont Web Services as a picture and display
that picture in your Windows Forms or WPF application.
Post by Antonio
How I can display a mapRepresentations in a desktop application (developed
by Visual studio 2008 VB)?
Thanks.
Antonio
Antonio
2008-09-05 06:37:01 UTC
Permalink
Post by I***@nospam.nospam
Basically you load image from MapPont Web Services as a picture and display
that picture in your Windows Forms or WPF application.
Can you give me an example of code to load image from MapPont Web Services
as a picture?

Thanks.

Antonio.
Derek Chan
2008-09-05 14:00:05 UTC
Permalink
Antonio,

I'd recommend you install the MWS 4.5 SDK at
http://www.microsoft.com/downloads/details.aspx?FamilyId=CB5148A9-F09E-4EC8-992F-16478C0B5D9A&displaylang=en


By default after running the .msi, you'll find the ImageMap samples
installed at:
C:\Program Files\Microsoft MapPoint Web Service SDK, Version
4.5\Samples\.NET 2.0\ImageMap

Hope that helps,
--
Infusion Development
http://www.infusion.com
Post by Antonio
Post by I***@nospam.nospam
Basically you load image from MapPont Web Services as a picture and display
that picture in your Windows Forms or WPF application.
Can you give me an example of code to load image from MapPont Web Services
as a picture?
Thanks.
Antonio.
Antonio
2008-09-05 14:41:05 UTC
Permalink
Post by Derek Chan
By default after running the .msi, you'll find the ImageMap samples
C:\Program Files\Microsoft MapPoint Web Service SDK, Version
4.5\Samples\.NET 2.0\ImageMap
sorry I'm a Newbie.
I have this code:

'Get the best view of two locations
Dim myLocations(1) As net.mappoint.staging.Location
myLocations(0) = New net.mappoint.staging.Location()
myLocations(1) = New net.mappoint.staging.Location()
myLocations(0).LatLong = New net.mappoint.staging.LatLong()
myLocations(1).LatLong = New net.mappoint.staging.LatLong()
myLocations(0).LatLong.Latitude = txtLat1.Text
myLocations(0).LatLong.Longitude = txtLong1.Text
myLocations(1).LatLong.Latitude = txtLat2.Text
myLocations(1).LatLong.Longitude = txtLong2.Text

Dim renderService As New net.mappoint.staging.RenderServiceSoap()
renderService.Credentials = New System.Net.NetworkCredential("xxxx",
"xxx")
renderService.PreAuthenticate = True


Dim mapRepresentations As net.mappoint.staging.MapViewRepresentations
mapRepresentations = renderService.GetBestMapView(myLocations,
"MapPoint.EU")

How I can display the map on my desktop application?

Thanks.

Antonio.
I***@nospam.nospam
2008-09-05 17:11:11 UTC
Permalink
After GetBestMapView you need to make a call to actually load image from web
service
by calling GetMap on renderService.

_images = _render.GetMap(...)
If _images.Length > 0 Then
With _images(0).MimeData
My.Computer.FileSystem.WriteAllBytes(.ContentID, .Bits, False)
End With
End If

How to display an image in GUI is out of topic here.
Post by Antonio
Post by Derek Chan
By default after running the .msi, you'll find the ImageMap samples
C:\Program Files\Microsoft MapPoint Web Service SDK, Version
4.5\Samples\.NET 2.0\ImageMap
sorry I'm a Newbie.
'Get the best view of two locations
Dim myLocations(1) As net.mappoint.staging.Location
myLocations(0) = New net.mappoint.staging.Location()
myLocations(1) = New net.mappoint.staging.Location()
myLocations(0).LatLong = New net.mappoint.staging.LatLong()
myLocations(1).LatLong = New net.mappoint.staging.LatLong()
myLocations(0).LatLong.Latitude = txtLat1.Text
myLocations(0).LatLong.Longitude = txtLong1.Text
myLocations(1).LatLong.Latitude = txtLat2.Text
myLocations(1).LatLong.Longitude = txtLong2.Text
Dim renderService As New net.mappoint.staging.RenderServiceSoap()
renderService.Credentials = New
System.Net.NetworkCredential("xxxx",
"xxx")
renderService.PreAuthenticate = True
Dim mapRepresentations As
net.mappoint.staging.MapViewRepresentations
mapRepresentations = renderService.GetBestMapView(myLocations,
"MapPoint.EU")
How I can display the map on my desktop application?
Thanks.
Antonio.
Antonio
2008-09-08 07:19:00 UTC
Permalink
Post by I***@nospam.nospam
After GetBestMapView you need to make a call to actually load image from web
service
by calling GetMap on renderService.
_images = _render.GetMap(...)
What type should I declare _images?

What parameters I must pass to _render.GetMap?
Post by I***@nospam.nospam
How to display an image in GUI is out of topic here.
OK.

Thanks.

Antonio.

Loading...