View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 661
Default World map embedded in userform.

Peter,

Hereby the requested co-ordinates might be different than the last, I had to
reset my google earth;

Top left: 53 degrees 32 min North / 01 degress 15 min East
Top right: 53 degrees 46 min North / 11 degrees 22 min East
Bottom right: 50 degrees 32 min North / 10 degrees 58 min East
Bottom left: 50 degrees 34 min North / 01 degrees 34 min East
Center: 52 degrees 13 min N / 06 degrees 25 min East
Mid top: 53 degrees 52 min North / 06 degrees 25 min East
Mid bottom: 50 degrees 40 min North / 06 degrees 25 min East
Mid left: 52 degrees 13 min North / 01 Degrees 26 min East
Mid right: 52 degrees 13 min North / 11 degrees 09 min East

In your original message there where these two lines;

Tp-lt 53:4n~01:38e = 53+(44/60) ~ -(1+(38/60)) = 53.73 ~ -1.633
Bt-rt 52:09n~06:10e = 52+(9/60) ~ -(6+(10/60)) = 52.15 ~ -6.167


In wich event do I put these? Do i need to put this somewhere?

Peter do you think that it's possible to, after I've clicked the map and the
coordinates are put into a sheet, a marker of some kind shows on the map on
the place I just clicked?
And if it is, I also would like a button to press if I want to remove these
markers.

Thanks in advance,

Cheers,

Paul

"Peter T" wrote:

From the info you gave it looks like your map grid is not simply rectangular
(as a street map typically is). The grid may be skewed in any one of a
number of ways. Eg longitudes not vertical and/or not parallel. Or maybe the
map is merely squashed in one direction. For some purposes it's inconvenient
that the world is spherical rather than flat !

Tp-lt 53:4n~01:38e = 53+(44/60) ~ -(1+(38/60)) = 53.73 ~ -1.633
Bt-rt 52:09n~06:10e = 52+(9/60) ~ -(6+(10/60)) = 52.15 ~ -6.167

I've omitted the calc but the horizontal/vertical ratio of these coord's is
2.86 vs the wd/ht of your image of 1.85 (966 / 528)

Will need coord's of the other corners and ideally at centre and perhaps at
the mid points of the edges.

Although it could be tedious it should be relatively straightforward to
interpolate mouse X:Y to the grid.

Regards,
Peter T





"Paul" wrote in message
...
Peter,

Some has gone wrong in my last reply... I had some internet problems last
night so that might be the reason...

Indeed europe intersects, but I'm creating country maps so it doesn't
affect
me that much.

the Top left coordinates from my first picture are 53 degrees 44 minutes
North / 01 degrees 38 minutes East.

Bottom right are 52 degrees 09 minutes N / 06 degrees 10 minutes East.

The heigth of my picture = 528 and the width = 966.

Can you help me out?

Cheers,

Paul.
"Peter T" wrote:

What are the grid coordinates at top left and bottom right corners. Does
the
meridian intersect, Europe so I guess it does, at what distance from the
left, as a fraction of the total width (ie a decimal between 0 & 1).

What is width & height of the image (get from properties).

Double check that coord's along the centre and vertical lines are as you
would expect (ie the scales linear).

Regards,
Peter T

"Paul" wrote in message
...
Peter,

Thanks for the reply that helps a lot just a couple of things I can't
figure
out and that has mostly to do with the co-ordinates;

I've got a map, from google earth, and I'm using co-ordinates in
degrees,
minutes (so 51 08N21 47E, etc etc), and I can't get the right
co-ordinates
to
be displayed on my map.

If I reach the top of my map one of the values states zero, but it
should
state 51 degrees 08 minutes North instead of zero.

Could you help me?

Cheers,

Paul

"Peter T" wrote:

Indeed you can embed a an image into the entire form or probably
better
into
an Image control. Click the "Picture" property and browse to your
image.

Set AutoSize to true and experiment with PictureSizeMode. Maybe later
you
can change Autosize to false.

In the form code (assuming the image control is named Image1)

Private Sub Image1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Range("A1").Value = X
Range("B1").Value = Y
End Sub

Private Sub Image1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

Me.Caption = X & " " & Y
End Sub


You will of course need to calibrate X & Y to relate to your map
coordinates. Assuming the Grid is linear in both axes (don't assume it
is),
maybe something like this

With Image1
east = (.Width / X) x (maxEast - minEast)
north = (.Height/ Y) x (maxNorth - minNorth)
End With

where max/min East/north are grid coord's at left, right top & bottom
of
the
map
Regards,
Peter T



"Paul" wrote in message
...
Hi,

Is it possible to embed a map into a userform? What I'm trying to
accomplish
is that a map, lets say europe, is displayed and everytime when the
user
clicks on the map the lat/long coordinates of the pointer are
transferred
to
an excel sheet.

Any ideas?

Cheers,

Paul