Klaus-

After further inspection I agree with you that this widget needs a proper tutorial. I was looking at the module itself trying to find some undocumented features (like a polygon or circle overlay instead of just a polyline) and came up empty handed.

After looking at the W3Schools tutorial @ https://www.w3schools.com/graphics/google_maps_overlays.asp I noticed that you could create multiple polyline segments using the native Google Maps API. The demo code in the LC 9.0.0 docs (not the dictionary, but the doc referenced in my previous post) uses the following example:

   put "55,-3,55,-5" into tPolylines["line"]["coordinates"]

It isn't documented, but this is a comma delimited list of lat/long value pairs (also separated by a comma) to be used as points for connecting line segments. So in the provided example a line segment is drawn from "55,-3" to "55,-5" on the map. But you can draw a triangle between Edinburgh (55,-3), New York (40,-74), and Cairo (30,31) then back to Edinburgh with this:

   put "55,-3,40,-74,30,31,55,-3" into tPolylines["line"]["coordinates"]

The closed triangle needs 4 sets of coordinates, not just 3, so it can return to the "home" point. Still not quite the polygon overlay that the Google Maps API provides, but a neat option that wasn't evident by reading the current documentation.

It's also not explicitly documented that the "color" property will accept a RGBA value so the following example provides an orange-ish overlay with a ~39% opacity (100 / 255):

   put "228,128,0,100" into tPolylines["line"]["color"]

In fact, the dictionary reference for polylines only shows RGB as an example. This is an extremely powerful widget... if you know what it is actually doing.

--Andrew Bell


From: Klaus major-k <kl...@major-k.de>
To: How to use LiveCode <use-livecode@lists.runrev.com>
Subject: Tutorial for MAP widget
Message-ID: <b0a88fff-4f02-4360-ba45-6cfe085ff...@major-k.de>
Content-Type: text/plain;       charset=us-ascii

Hi all,

could someone (the mothership?) please create a little tuorial
for the new MAP widget? This is really not self-explaining.
How to let the user create a new marker etc...

Thanks a lot!


Best

Klaus
--
Klaus Major
http://www.major-k.de
kl...@major-k.de




_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to