PDA

View Full Version : get Radius of displayed area while using ViewByScale



ranjithtellis
09-21-2005, 02:15 AM
Hi,

How to get the Radius of the displayed map area. The map is being rendered using ViewByScale & the image height = 400 & width = 450.

1. map scale = 5000000;
2. Image height = 400;
3. Image widht = 450;
4. Default dpi. (should this be taken into account).

What woud be the radius of the visible area of the map?

Any ideas appreciated.

thanks in advance.

ranjith

Wilfried
09-21-2005, 12:26 PM
Hi,

I dont understeand (but I'm learning English :)
The window you display the map in is a rectangular area, and a radius is from a circle, so I'm confused and dont understeand :(

ranjithtellis
09-22-2005, 12:14 AM
Yes, it is rectangular. I need the approximate radius of the map rendered in that rectangular area.

Let me try & explain again:

1. The height & width of the area where the map is displayed remains constant. And the MapOptions height & width also are set to this same value -
Height = 400;
Width = 450;
mapOptions.Format.Height = Height;
mapOptions.Format.Width = Width;

2. The map is rendered using ViewByScale.
scale = 5000000;
mapViews[0].CenterPoint = latLong;
mapViews[0].MapScale = scale;

Now the map is displayed in the rectangular area. I need to know what would be the approximate radius of the map which is rendered with the scale mentioned above. Note: the scale keeps changing.

Hope the query is clear.

Wilfried
09-22-2005, 02:23 PM
Hi,

I still dont underteand it all. Maybe some other candrop in here ?

ranjithtellis
10-07-2005, 06:01 AM
Hi,
See the map image below for an example.
In this map how do i get the distance from the left to the right. I know the image width & scale. How will i be able to determine the actual total distance from the left of the map to the right say from colarado to washington. The map is rendered using View by scale.

http://www.mp2kmag.com/images/gallery/screenshots/msdn-events-map_420_frame.gif

calv1ns
10-07-2005, 09:32 PM
hey ranjithtellis

I think you mean width not radius - radius is the distance between the center and the outside edge of a circle. When dealing with rectangles like the map above you use the terms Height and Width. Height is the vertical. Width is the horizontal.

Here is a VB6 function that will display a a message box with the height and width of the map window in pixels and GeoUnits.

As with all my code - globally define
Dim myapp as MapPoint.Application 'and
Dim myobj as MapPoint.Map


Public Function getmap_extents() As Integer
Dim wk_istat As Integer
Dim X, Y As Long

wk_istat = 1

If myapp.Units = 0 Then
wk_units = " Miles"
ElseIf myapp.Units = 1 Then
wk_units = " Kilometers"
End If
wk_str = " Map Window Height: " & myobj.Height & vbCrLf
wk_str = wk_str & " Map Window Width: " & myobj.Width & vbCrLf
wk_str = wk_str & " Map Pixel Size: " & myobj.PixelSize & vbCrLf
Y = myobj.Height * myobj.PixelSize
X = myobj.Width * myobj.PixelSize
wk_str = wk_str & " Map Units are:" & wk_units & vbCrLf
wk_str = wk_str & " Height is: " & Y & wk_units & vbCrLf
wk_str = wk_str & " Width is: " & X & wk_units & vbCrLf

wk_rsp = MsgBox(wk_str, vbOKOnly)
getmap_extents = wk_istat
End Function


ciao,

Wilfried
10-10-2005, 01:08 PM
Hi,

thats what happens if language is alian for both questionar and answernoar (if this word exists :)

calv1ns
10-11-2005, 01:31 PM
Funny Wilfried


thats what happens if language is alian for both questionar and answernoar (if this word exists


You get Mohamed to translate.


That is what happens if the language is alien for both the questioner and the responder.

Where is our French Couscous vendor anyway?

Ciao,

Mohamed
10-23-2005, 08:42 AM
Hi,

Where is our French Couscous vendor anyway?

Still alive!
Thanks for remembring !

- The Camels are using Mappoint to deliver the couscous in Paris. I hope there is no camels aviary influenza!!!!

- 4 weeks in Morrocco in a place without electricity, without computer and without time to use it ( Pointer 2927'40" N , 1005'02" W ) .
- 2 weeks preparing Marketing courses for the high school
- And a lot of travelling in France for my main job

So, not enough time to visit actively this sympathetic forum!

As the last year I will be the sponsor of a marathonman. Any idea to use Mappoint to follow the guy in his marathon of sands in a screen in my stores in Paris? ( ACL? )

http://fberahou.club.fr/bledrunner/accueil.html

oAiC ( = Ciao in Alian language :lol: )

Mohamed

Wilfried
10-23-2005, 02:46 PM
Hi Mohamed,

Glad you still here !
I was already thinking you have been eaten by a very hungry camel or eaten yourself too much couscous :)

calv1ns
10-25-2005, 09:13 PM
Here I thought you were fasting... Way to busy to fast! eh?

Best of the season to you Moh. Welcome back.

Ciao,