Page 1 of 1
Map Widget Markers Array - Changing Icons
Posted: Wed May 12, 2021 4:09 pm
by JereMiami
I recall that we may be able to change the icons in the map widget from the traditional red marker to something else. I may be remembering wrong. I look at the "markers" command for the full array and get this in the LC Dictionary:
The marker array has the following form: { : { "title":
It appears to be missing some text. Anyone know the full list of keys for the array or more to the point if we are able to change the icons, for instance, into a beach umbrella or hamburger type icon?
Re: Map Widget Markers Array - Changing Icons
Posted: Thu May 13, 2021 1:27 am
by jameshale
This is the rest of the text..9as far as I can tell…
The marker array has the following form: { tag for marker: { "title": title of the marker, "subtitle": optional subtitle of the marker, "coordinates": coordinates of the marker }, tag for marker: { ... }, ... }
Re: Map Widget Markers Array - Changing Icons
Posted: Thu May 13, 2021 1:29 pm
by JereMiami
Thanks! I'll have a look at it and be back.
Re: Map Widget Markers Array - Changing Icons
Posted: Thu May 13, 2021 4:59 pm
by JereMiami
For some reason, I cannot get anything but the markers to show up. No "title" description, just the red marker.
Code: Select all
on openCard
wait .5 seconds
set the region of widget "map" to gCoordinates & "," & ".005,.005"
wait 2 seconds
set the showsUserLocation of widget "Map" to true
put gCoordinates into tMarkers[1]["coordinates"]
put "Test" into tMarkers[1]["title"]
set the markers of widget "map" to tMarkers
end openCard
Why just the red marker and no title?
Re: Map Widget Markers Array - Changing Icons
Posted: Thu May 13, 2021 5:32 pm
by jacque
You can set the shape of the markers with the markerPoints property. The dictionary tells you how. You can create some elaborate markers this way. Bernd sent me an example years ago where each marker spelled my name, which was both impressive and funny.
Re: Map Widget Markers Array - Changing Icons
Posted: Thu May 13, 2021 5:44 pm
by JereMiami
Nice- I am going to dig into it now that I know it is possible. Right now, I am stuck on getting any of the information in the markers array to show, particularly ["title"] and ["subtitle"] for whatever reason. The traditional red marker is in the right coordinates though.
Re: Map Widget Markers Array - Changing Icons
Posted: Fri May 14, 2021 1:23 am
by jameshale
Haven’t used them myself just had access to full dictionary entry

Re: Map Widget Markers Array - Changing Icons
Posted: Fri May 14, 2021 5:08 am
by jacque
JereMiami wrote: ↑Thu May 13, 2021 5:44 pm
Nice- I am going to dig into it now that I know it is possible. Right now, I am stuck on getting any of the information in the markers array to show, particularly ["title"] and ["subtitle"] for whatever reason. The traditional red marker is in the right coordinates though.
I'm afraid I misinformed you. MarkerPoints works with graphic objects. I missed the part where you said you were working with the map widget. I don't see a way to change the shape of those.
Re: Map Widget Markers Array - Changing Icons
Posted: Fri May 14, 2021 11:30 am
by JereMiami
No worries. Let's try a different avenue. Is there any way to get the htmlText of the map widget, like you obviously can for the browser widget?
Something like for the map widget:
Code: Select all
on mouseUp
put the htmlText of widget "map" into fld "url"
end mouseUp
Clearly, it's not that easy for the map widget, but there must be some way to get the html of the map widget, no?