Tutorial for MAP widget

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tutorial for MAP widget

Knapp Martin via use-livecode
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
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tutorial for MAP widget

Knapp Martin via use-livecode
Like this?
https://livecode.com/docs/9-0-0/components/map-widget/

I will be talking a little about my Map widget implementation during a  
LC Global talk next month.

--Andrew Bell

> From: Klaus major-k <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Subject: Tutorial for MAP widget
> Message-ID: <[hidden email]>
> 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
> [hidden email]
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tutorial for MAP widget

Knapp Martin via use-livecode
In reply to this post by Knapp Martin via use-livecode
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 <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Subject: Tutorial for MAP widget
> Message-ID: <[hidden email]>
> 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
> [hidden email]
>



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