1. Martin Mueller
  2. PowerBuilder
  3. Monday, 17 September 2018 14:15 PM UTC

Hi,

we are looking for a way to generate a campsite map on the fly. We have x and y coordinates of (about 500) objects, object ids and names. The user of our application should be able right click to an object and a menu should appear to do further actions.

My first idea was to create a dynamic datawindow with all objects as rectangle. The color of the rectangles can be changed with modify. The map of the campsite should be in the background of the datawindow as jpg (we get them from the campsite owner).SyntaxFromSQL is "very" slow, so I tried to create the datawindow with create.My problem: I cannot see the map in the background, because the datawindow in the forground will not get transparent.Is there a comfortable way to create such a map in PB 2017?Thanks in advanceMartin

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 17 September 2018 17:23 PM UTC
  2. PowerBuilder
  3. # 1

If you set a background picture for a DataWindow, you also have to set background brush mode to picture or the image will not be seen.

Comment
  1. Martin Mueller
  2. Friday, 21 September 2018 15:02 PM UTC
Hi Roland,



that's it :)



Thanks a lot!
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 17 September 2018 18:32 PM UTC
  2. PowerBuilder
  3. # 2

The DataWindow clicked event gives you the coordinates. Instead of creating DataWindow objects over the objects on the map, just compare the clicked x/y coordinates to the array of coordinates.

Comment
  1. Chris Pollach @Appeon
  2. Monday, 17 September 2018 18:57 PM UTC
In addition to Roland's "event" suggestion ... also have a look at the "GetObjectatpointer( )" command as well to make the script programming easier.
  1. Helpful
  1. Martin Mueller
  2. Friday, 21 September 2018 15:02 PM UTC
Hi Roland, hi Chris, thanks for your suggestions. At the moment, we are using the clicked event, but we will check GetObjectatpointer( ) too.



Thanks
  1. Helpful
There are no comments made yet.
Elvis Cardenas Accepted Answer Pending Moderation
  1. Tuesday, 18 September 2018 01:00 AM UTC
  2. PowerBuilder
  3. # 3

necesitas graficar mapas? a mi me funciona muy bien la api V3 de google map, lamentablemente solo puedo ggraficar un maximo de 250 puntos.

 

Do you need to graph maps? it works very well with the api V3 of google map, unfortunately I can only graph a maximum of 250 points.

 

Attachments (1)
Comment
  1. Martin Mueller
  2. Friday, 21 September 2018 14:59 PM UTC
Thanks Elvis for your idea, but our customers have more than 800 objects
  1. Helpful
There are no comments made yet.
Martin Mueller Accepted Answer Pending Moderation
  1. Friday, 5 July 2019 04:24 AM UTC
  2. PowerBuilder
  3. # 4

Hi Roland,

we resume our work on this project. All technical features are working fine, but we have one problem. We load the background picture of the datawindow into a invisible picture object to get the size of the picture

select map_picture into :ls_picture from table_xy where ... ;
p_1.PictureName = ls_picture
ll_picture_x = p_1.width
ll_picture_y = p_1.height

dw_1.Modify("datawindow.brushmode=6")
dw_1.Object.datawindow.picture.Mode=0        // 0 - Original Size
dw_1.Object.datawindow.picture.File=ls_picture

dw_1.width = ll_picture_x
dw_1.height = ll_picture_y

Now, we have the problem, that the picture is always centered. It should be at a fix point on the upper left corner of the datawindow, so that we can scroll the datawindow, when the picture is larger than the main monitor size.

Is there a way to make this happen?

Best regards

Martin

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.