ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Drawing Polygons on ImageEnVect1 & maps

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bruce Posted - Dec 04 2014 : 15:42:45

The sample project "Geo Maps - Use the GPS data in photos to show Their location on a map."
The demo page is very interesting (http://www.imageen.com/demos/index.html).

But now I need to draw on the map (using code), polygons and circles (with geographic latitude and longitude)

The code could be as follows:

var
     Point: Array of TPoint;
begin

    Draw_hobj: ImageEnVect1.AddNewObject = ();
    ImageEnVect1.SetObjBackTo (Draw_hobj, -1);

    setlength (apoint, 3);
    Apoint [0] .X: = 500; // Map.LongitudeToBmpX (-16.3995);
    Apoint [0] .And: = 500; // Map.LatitudeToBmpY (-71.5373);

    Apoint [1] .X: = 600; // Map.LongitudeToBmpX (-16.4895);
    Apoint [1] .And: = 600; // Map.LatitudeToBmpY (-71.6473);

    Apoint [1] .X: = 200; // Map.LongitudeToBmpX (-16.4895);
    Apoint [1] .And: = 600; // Map.LatitudeToBmpY (-71.6473);

    ImageEnVect1.ObjKind [Draw_hobj]: = iekPOLYLINE;
    ImageEnVect1.ObjLabelPosition [Draw_hobj]: = ielBegin;
    ImageEnVect1.ObjTransparency [Draw_hobj]: = 100;
    ImageEnVect1.ObjPenWidth [Draw_hobj]: = 10;
    ImageEnVect1.ObjPenColor [Draw_hobj]: = clRed;
    ImageEnVect1.ObjStyle [Draw_hobj]: = [ievsSelectable, ievsVisible];
    ImageEnVect1.ObjName [Draw_hobj]: = 'None';
    ImageEnVect1.ObjText [Draw_hobj]: = 'hello';
    // Sept. With your Poly_pts some value //
    ImageEnVect1.OffScreenPaint: = true;
    ImageEnVect1.SetObjPolylinePoints (Draw_hobj, apoint);
    ImageEnVect1.Update;

It does not work when you load maps on the component ImageEnVect1

   map: = TIESlippyMap.Create (iesmpMapQuest, 'cache');
   map.Zoom: = 4;

   ImageEnVect1.SoftShadow.Enabled: = true;
   ImageEnVect1.LegacyBitmap: = false;
   ImageEnVect1.IEBitmap.VirtualBitmapProvider: = map;
   map.Zoom: = 15;
   map.Latitude: = -16.3995;
   map.Longitude: = -71.5373;

Some sage who can enlighten this grasshopper.

regards

Bruce Cano
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 16 2014 : 17:10:31
Hi Bruce

The nature of virtual bitmaps frees the display control from needing to understand its content. To implement automatic movement of objects on a virtual bitmap, it would need to understand its content and/or not be virtual. It makes more sense for the supplier of the virtual image update the location of objects or in some way notify the display app of the change.

There is not an easy solution to that from a generic library perspective. It would be easier for your app, knowing the content, to iterate through the objects and update their position.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bruce Posted - Dec 15 2014 : 07:52:56
It is in plans to implement these features?

regards
xequte Posted - Dec 06 2014 : 18:57:27
Hi Bruce

Its not quite that simple, as the Slippy maps in ImageEn use a "Virtual bitmap," so there are no fixed positions. If you explicitly draw a polygon/circle then it will be in the wrong position when the image is scrolled or zoomed.

So either you output your map to another bitmap (i.e. so it is now a fixed image where the pixels/positions do not change) or you draw your polygon/circle "virtually".

The latter is the best solution if you wish your map to still be interactive. See the Geomaps demo and the way that the pins are drawn in the Backbuffer event of TImageEnView. In that event you will map a specific GPS coordinate to a screen position and draw your shape relative to that (and also stretching its size based on the level of zoom).

If you are using ImageEnVect objects instead, then whenever the map changed you would need to iterate through your objects and reposition them based on their GPS coordinates.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bruce Posted - Dec 04 2014 : 20:58:20
I try to explain with a simple example.

From 4 geographical coordinates (latitude, longitude) I want to draw a rectangular polygon on a TIESlippyMap.


    map: = TIESlippyMap.Create (iesmpMapQuest, 'cache');
    ImageEnVect1.LegacyBitmap: = false;
    ImageEnVect1.IEBitmap.VirtualBitmapProvider: = map;
    map.Zoom: = 15;
  
And when zooming or displacements, the polygon retain its position.

I wish to draw the polygon by code (will extract the coordinates of a database).

regards

Bruce

Developer System

--- --- translated by google
xequte Posted - Dec 04 2014 : 16:27:38
Hi Bruce

In what way does it not work?

Please also see:

http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1905


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com