Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

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






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

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








  #8   Report Post  
Posted to microsoft.public.excel.programming
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









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

Hi Paul,

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?


Those are simply edited "workings" to show how to convert grid coordinates
to decimals, and to get a quick idea if the grid is rectangular (for want of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I mean in
terms of scaling to your image. What steps have you done so far towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

Hi Paul,

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?


Those are simply edited "workings" to show how to convert grid coordinates
to decimals, and to get a quick idea if the grid is rectangular (for want of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I mean in
terms of scaling to your image. What steps have you done so far towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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















  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

Peter,

The grid is not rectangular, the map I'm currently working on is a complete
overview of the Netherlands, and therefore the grid is following the curves
of the earth.

If you've got suggestions for maps, other than google earth maps, that are
easier to handle, I would like to hear them..

Cheers,

Paul

"Peter T" wrote:

Hi Paul,

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?


Those are simply edited "workings" to show how to convert grid coordinates
to decimals, and to get a quick idea if the grid is rectangular (for want of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I mean in
terms of scaling to your image. What steps have you done so far towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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














  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

Even if the grid is not rectangular, with sufficient known coordinates to
hand (as indeed you have) it should be possible to devise your own
interpolation algorithm to relate mouse X:Y to the grid.

Regards,
Peter T

"Paul" wrote in message
...
Peter,

The grid is not rectangular, the map I'm currently working on is a
complete
overview of the Netherlands, and therefore the grid is following the
curves
of the earth.

If you've got suggestions for maps, other than google earth maps, that are
easier to handle, I would like to hear them..

Cheers,

Paul

"Peter T" wrote:

Hi Paul,

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?


Those are simply edited "workings" to show how to convert grid
coordinates
to decimals, and to get a quick idea if the grid is rectangular (for want
of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they
could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I mean
in
terms of scaling to your image. What steps have you done so far towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or
skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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
















  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default World map embedded in userform.

Peter,

Could you point me in the right direction, I have no clue where to begin...

Cheers,

Paul

"Peter T" wrote:

Even if the grid is not rectangular, with sufficient known coordinates to
hand (as indeed you have) it should be possible to devise your own
interpolation algorithm to relate mouse X:Y to the grid.

Regards,
Peter T

"Paul" wrote in message
...
Peter,

The grid is not rectangular, the map I'm currently working on is a
complete
overview of the Netherlands, and therefore the grid is following the
curves
of the earth.

If you've got suggestions for maps, other than google earth maps, that are
easier to handle, I would like to hear them..

Cheers,

Paul

"Peter T" wrote:

Hi Paul,

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?

Those are simply edited "workings" to show how to convert grid
coordinates
to decimals, and to get a quick idea if the grid is rectangular (for want
of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they
could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I mean
in
terms of scaling to your image. What steps have you done so far towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or
skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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

















  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default World map embedded in userform.

Why not plot those 9 refs on paper (like on a graph). Convert the minutes to
decimals of a degree first (as in demonstrated earlier). Dig out your old
maths & trig school books.

Just at a visual glance of those ref's I rather suspect they are not
accurate, even though no doubt the grid is "skewed".

Regards,
Peter T


"Paul" wrote in message
...
Peter,

Could you point me in the right direction, I have no clue where to
begin...

Cheers,

Paul

"Peter T" wrote:

Even if the grid is not rectangular, with sufficient known coordinates to
hand (as indeed you have) it should be possible to devise your own
interpolation algorithm to relate mouse X:Y to the grid.

Regards,
Peter T

"Paul" wrote in message
...
Peter,

The grid is not rectangular, the map I'm currently working on is a
complete
overview of the Netherlands, and therefore the grid is following the
curves
of the earth.

If you've got suggestions for maps, other than google earth maps, that
are
easier to handle, I would like to hear them..

Cheers,

Paul

"Peter T" wrote:

Hi Paul,

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?

Those are simply edited "workings" to show how to convert grid
coordinates
to decimals, and to get a quick idea if the grid is rectangular (for
want
of
a better description) which it did not appear to be. Were you able to
follow. FWIW I put the calc's in cell formulas. For your purposes they
could
go in cells or calculated in VBA, it doesn't really matter.

I haven't yet looked in detail at your additional ref's. Have you, I
mean
in
terms of scaling to your image. What steps have you done so far
towards
interpolating mouse X:Y to a grid ref. Is the grid "rectangular" or
skewed
as I suspect.

Regards,
Peter T




"Paul" wrote in message
...
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



















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error with userform, "unable to create embedded object" Jeff Excel Programming 4 November 1st 05 07:44 PM
Userform Image Control and embedded images tim Excel Programming 13 April 5th 05 01:32 PM
Displaying embedded chart on userform Bill Renaud[_2_] Excel Programming 2 April 6th 04 11:16 AM
Chart embedded in UserForm Tim[_21_] Excel Programming 2 September 10th 03 11:13 AM
unable to create embedded object on a userform Robert Nobles Excel Programming 0 September 9th 03 08:49 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"