www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

question about landmarks and drawing on the map

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack
View previous topic :: View next topic  
Author Message
matthew



Joined: 23 Jul 2008
Posts: 2

PostPosted: Wed Jul 23, 2008 10:45 am    Post subject: question about landmarks and drawing on the map Reply with quote

Hello,

Is it possible to draw lines and splines on map?.

And another question. I have collection of points (longitudal and latitudal
coordinates). Can I display them on the map?. Can I then draw a spline
going through these points?.

Yet another Smile. Can landmarks have whatever shape I like and can they
be whatever colour and fill I like?.

Cheers.
Back to top
View user's profile Send private message
hlohning



Joined: 08 Sep 2006
Posts: 277
Location: Austria

PostPosted: Mon Aug 25, 2008 5:11 pm    Post subject: Reply with quote

Matthew,

TGeoMap is designed to have full access to the maps. You can virtually draw everything on the maps (landmarks, splines, whatever...) by uising the events OnDataRendered and OnDrawLandmark.

Please see the following URLs for details:

http://www.lohninger.com/helpcsuite/ondatarendered_geomap.htm

and


http://www.lohninger.com/helpcsuite/ondrawlandmark_geomap.htm

Regards,

Hans
_________________
Hans Lohninger
Software Development Lohninger
http://www.lohninger.com/
Back to top
View user's profile Send private message Visit poster's website
captnkrunch



Joined: 27 Mar 2007
Posts: 19

PostPosted: Thu May 19, 2011 8:52 pm    Post subject: OK but those are "batch" techniques Reply with quote

I'm trying to use TGeoMap in a tracing application so I need to draw while the mouse moves. Is there a Canvas object for a TGeoMap? I promise to disable panning, etc. while this is going on. Specifically, I need to use MoveTo or LineTo or their equivalents in real time.
Back to top
View user's profile Send private message
hlohning



Joined: 08 Sep 2006
Posts: 277
Location: Austria

PostPosted: Fri May 27, 2011 6:36 am    Post subject: Reply with quote

Sorry for the late reply - too many computers, too little time.... Very Happy

I created a small sample application which shows how to draw on a map. The application records the mouse movement in a cyclic buffer and displays the mouse trace on the map. You can even zoom and pan....

This sample program (written in Delphi) can be downloaded from here:

http://www.lohninger.eu/exmpl-preview/geomap_trackmouse.zip

Hope this helps,

Hans
_________________
Hans Lohninger
Software Development Lohninger
http://www.lohninger.com/
Back to top
View user's profile Send private message Visit poster's website
captnkrunch



Joined: 27 Mar 2007
Posts: 19

PostPosted: Sun May 29, 2011 6:52 am    Post subject: Reply with quote

Thanks. The example was very helpful. It hadn't occurred to me to display the entire trace every time the mouse moved.
Back to top
View user's profile Send private message
antons



Joined: 13 Jun 2011
Posts: 3

PostPosted: Tue Jun 14, 2011 9:21 am    Post subject: Reply with quote

Hello!
I'm using TGeoMap to draw several landmarks. Drawing occurs in GeoMap.OnDrawLandmark based on associated record. In this method I set landmark's BGColor also.
Landmarks may change their state (become selected, for instance) by actions in another control.
Here's what I do:
Code:

// set bg color according to selection state and draw additional text near the landmark
procedure TfrmMain.GeoMapDrawLandmark(Sender: TObject; var Handled: Boolean; const Canvas: TCanvas; APoint: TPoint; const LandMarkData: TLandMark);
type PLandMark = ^TLandMark;
var pStat: PStation;
begin
  Canvas.Brush.Color := clCream;
  Canvas.Brush.Style := bsClear;
  pStat := PStation(LandMarkData.Tag);
  with PLandMark(@LandMarkData)^.SymbolProps do // hack
    if pStat.Selected then
      BGColor := clYellow
    else
      BGColor := clBlue;
  Canvas.TextOut(APoint.X, APoint.Y, string(pStat.Name));
end;


Now when landmark state changes I have to repaint overall map for changes to take effect what causes serious flicker. How can I tell the map to refresh only certain landmark or only small part of image?
Back to top
View user's profile Send private message
antons



Joined: 13 Jun 2011
Posts: 3

PostPosted: Fri Jul 01, 2011 9:52 am    Post subject: Reply with quote

Still no feedback... Fortunately I did manage to solve the issue. GeoMap.DoubleBuffered was the answer.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group