Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

Maplib position

Fri Aug 13, 2004 2:29 pm

The .bmp I scaled doesn't display properly in the map control (evb). It looks to have a large white border which pushes the picture down and to the right. I did have it working. Any idea what I'm doing wrong?

User avatar
johan
GpsGate
Posts: 15423
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Maplib position

Fri Aug 13, 2004 4:03 pm

Most likely you have not set a proper Position object to Map.Position When this is not done, the map is displayed the way you describe.

Regards,
Johan

Franson Support

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: Maplib position

Fri Aug 13, 2004 9:54 pm

Sorry if these are dumb questions I'm new at this.

When do I set the map.postion? Do I need to get the co-ordinates of the center of the map and set these at the .position?
I really need the map to be in the correct position as soon as I call the .update method after opening the map

User avatar
johan
GpsGate
Posts: 15423
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Maplib position

Fri Aug 13, 2004 10:00 pm

Yes, you need to set Map.Position to a relevant position. If you want to center the map, you need to set the position to the whatever position is in the center.

If you dynamically want to calculate the center position of a map do the following.

Get a MapData object using MapLib.GetMapDataByName
Get the size in pixels of you map using MapData.Size

Divide X and Y by 2 and then by using Map.PointToPosition you can get a geo Position object that represents the center of the map.

Set this Map.Position to this Position object.

Regards,
Johan

Franson Support

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: Maplib position

Sun Aug 15, 2004 5:49 pm

All of my maps (bitmaps) are same size 130 by 260 pixels. So the center is 65 x 260.
can you give me a sample piece of code? based on this I can't seem to set 'point'.


Thanks
Simon

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: Maplib position

Sun Aug 15, 2004 6:30 pm

That should've been 65 x 130!!

User avatar
johan
GpsGate
Posts: 15423
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Maplib position

Sun Aug 15, 2004 6:41 pm

' eVB Pocket PC

Dim objPoint As Point

objPoint = CreateObject("GpsViewCE.Point")
objPoint.X = 130
objPoint.Y = 65

Dim objPos As Position

Set objPos = Map1.PointToPosition(objPoint)
Set Map1.Position = objPos

Map1.Update


Regards,
Johan

Franson Support

jhettena
Posts: 102
Joined: Wed Dec 15, 2004 6:21 am
Location: USA
Contact: Website

RE: Maplib position

Tue Dec 28, 2004 6:09 pm

In the case of the 'extra' space, how does one prevent that area from being geocoded? Should the raster map be cropped (eliminating non map area details) before being scaled into a MapLib?

Return to “GpsTools”