MapView Plugin

1,212 views
Skip to first unread message

ECEisLife

unread,
Jul 26, 2020, 10:06:52 AM7/26/20
to DroidScript
MapView plugin

Here are the supported features for the current version:

maptypes [includes DARKMAP]
markers
infowindows
polylines
polygons
circles
rectangles
traffic layer
transit layer
bicycling layer
heatmaps
routes/directions services
places service
    searching for places
    placesautocomplete
    queryautocomplete
    place details
distance matrix
elevations
locator
event listeners

Here's the link on playstore

Regards 



Steve Garman

unread,
Jul 26, 2020, 6:54:47 PM7/26/20
to DroidScript
Is this intended to be a plugin I can use within DroidScript?

If so, how do I install it?

Steve Garman

unread,
Jul 27, 2020, 2:02:49 AM7/27/20
to DroidScript
You won't be surprised to learn that I finally spotted the prominent download arrow enabling me to purchase the plugin

Steve Garman

unread,
Jul 27, 2020, 4:21:04 AM7/27/20
to DroidScript
The "Locate method" example code in the plugin docs throws an error

"map.ShowLocation is not a function"

wheelie tips

unread,
Dec 11, 2021, 10:43:11 PM12/11/21
to DroidScript
Good morning,
I enjoy your plugin very much and the documentation of it, easy to use!

I have two questions if you may:
1. I'm trying to use the "Getters" methods for a Marker, for ex. the "GetTitle(callback)", what I can't find is what is/are the parameters that the callback function expects to get the title? 

marker.GetTitle(callback)

function callback( XXX )
{
   console.log ( "title is: " + XXX )
}

2. for some reason when I try to create a dark map it ignores the request, if fact, no matter what maptype I set in the CreateMapView it doesn't affect the map, no errors also, all show the "ROADMAP" type map
map     = app.CreateMapView(apiKey, 1, 1.07, 1, 1, 4, "DARKMAP");

can you pls let me know what is it I'm missing?

Thank you very much in advance!
Cheers,
WT

wheelie tips

unread,
Dec 11, 2021, 11:15:06 PM12/11/21
to DroidScript
pls ignore the first question, got it to work.

marker.GetTitle(callback)

function callback( title)
{
   console.log ( "title is: " +  title  )
}

wheelie tips

unread,
Dec 12, 2021, 12:27:37 AM12/12/21
to DroidScript
one more question if you don't mind; how can I add an image to the infowindow? Following this example, I add the following to the infowindow

userInfo = "<div style='float:left'><img src='http://i.stack.imgur.com/g672i.png'></div><div style='float:right; padding: 10px;'><b>Title</b><br/>123 Address<br/> City,Country</div>"
infowindow = map.CreateInfoWindow( userInfo, objPayload.latitude, objPayload.longitude, false );  

But that broke something and no infowindow pops when clicking the icon, using other tags like <b> and <br> work, but I couldn’t get the <img> tag to work; any suggestions on how to add an image to the infowindow (preferably a local image)?

Thx again!
Best,
WT

Steve Garman

unread,
Dec 12, 2021, 1:25:29 AM12/12/21
to DroidScript
@WT

I'm sure you will get excellent support from Jumar as always but you might find it interesting to know that I have a little function I sometimes use as a callback when I find a callback I don't know what arguments are available and how many

It can't guess the names of the parameters but it tries to tell you as much as it can about each one

// DroidScript test callback

function testCallback()
{
     var arg,argType,argVal;
     var argc=arguments.length;
     var ths = typeof this;
     if(this && this.hasOwnProperty("GetType")&& typeof this.GetType=="function")
        ths=this.GetType();
     var msg="this is "+ ths;
     if(argc==0) msg+="\nno arguments";
     for(var i=0; i<argc; i++)
     {
         arg="p"+(i+1);
         argType = typeof arguments[i];
         if(argType=="object")
            argVal=JSON.stringify(arguments[i]);
         else argVal = arguments[i];
         msg += "\n"+ arg+"("+argType+") = "+argVal;
     }
     alert(msg);

wheelie tips

unread,
Dec 12, 2021, 3:56:41 AM12/12/21
to DroidScript
@Steve - this is super useful!! thanks much for sharing!!

wheelie tips

unread,
Dec 12, 2021, 5:26:50 PM12/12/21
to DroidScript
ok, so i've figured out the image issue; the img source should have double quotation marks (marked in red):

info = "<img src=" + '"' + pathUsers + '/654841213.png' + '"' + ">" 
infoWindow.SetContent(info)

wheelie tips

unread,
Dec 13, 2021, 2:35:12 AM12/13/21
to DroidScript
couple of minor hiccups in the plugin documentation:

doc1.png

doc2.png

wheelie tips

unread,
Dec 13, 2021, 4:54:40 AM12/13/21
to DroidScript
what would it take for the Plugin to cover the radius_changed event? 
currently, the circle's available events are: 
  • center_changed
  • click
  • dblclickdrag
  • dragend
  • dragstart
Best,
WT

wheelie tips

unread,
Dec 14, 2021, 4:32:03 AM12/14/21
to DroidScript
the event "center_changed" for the circle doesn't fire... can't get the center of the circle when dragging it.

ECEisLife

unread,
Dec 14, 2021, 7:28:54 AM12/14/21
to DroidScript
Hi there whelie

Sorry for the late reply.

For all the event listener. It uses the standard event listener of Google Map. As long as you got the exact event name passed into the AddListener method, it should probably work as intended. For the  radius_changed event, have you tried listening to this event?

Could you post some snippets of your code for the  "center_changed" event listener?

Regards
Jumar

wheelie tips

unread,
Dec 14, 2021, 12:16:13 PM12/14/21
to DroidScript

@Jumar
Thank you for your reply!

I know that you are super busy with the new editor (I assume with other things too);I do appreciate you finding the time to reply.

I will draft a few examples for you tomorrow as my current code is too full to copy/paste an example.

Thanks again!
WT

wheelie tips

unread,
Dec 15, 2021, 2:46:12 AM12/15/21
to DroidScript
Good morning, the following example is for the "DARKMAP", circle.AddListener('center_changed','On_CircleCenterChanged'); and circle.AddListener('radius_changed','On_CircleRadiusChanged');

pls have a look at the screencast, and the code I've used (replaced the print to the debug window back to console.log)


//Called when application is started.
function OnStart()
{
       lay = app.CreateLayout("Absolute", "VCenter, FillXY");

     // map stays in default view, no dark mode applied        
    map = app.CreateMapView(apiKey, 1, 1.07, 7, 125, 11, "DARKMAP");
    map.SetOnReady(Map_OnReady);
    lay.AddChild(map)
       
        //Add layout to app.        
        app.AddLayout( lay );
}

function Map_OnReady()
{
    console.log(">>>>>> Map_OnReady")
   
    circle = map.CreateCircle(7, 125, 5000);
    circle.SetDraggable(true);
    circle.SetEditable(true);
    circle.AddListener('dragend',       'On_CircleDragEnd');
    circle.AddListener('center_changed','On_CircleCenterChanged');
    circle.AddListener('radius_changed','On_CircleRadiusChanged');
}

function On_CircleDragEnd(e) {
    console.log(">>>>>> On_CircleDragEnd " + e)
}

function On_CircleRadiusChanged(e) {
    console.log(">>>>>> On_CircleRadiusChanged " + e)
}

function On_CircleCenterChanged(e) {
    console.log(">>>>>> On_center_changed " + e)
}

///////////////////////////////////////////////////

another quick point; in all the "Getters" sections docs, there is no info on the parameters the callbacks expect.

Thank you very much in advance!
WT

ECEisLife

unread,
Dec 16, 2021, 12:46:26 AM12/16/21
to DroidScript
Hi wheelie

All the getters return a stringified object. Make sure to parse the json first. I haven't look into testing your code yet. I will surely update you

wheelie tips

unread,
Dec 16, 2021, 1:17:32 AM12/16/21
to DroidScript
got it, thx, looking forward to your update.
Best,
WT

ECEisLife

unread,
Dec 16, 2021, 4:06:29 AM12/16/21
to DroidScript
Hi there wheelie,

I just sent you an update regarding on this issue. Please reply on this thread if you do find it working or not.

Regards
Jumar

wheelie tips

unread,
Dec 16, 2021, 4:42:39 AM12/16/21
to DroidScript

@Jumar - many thanks for your email!

re 'center_changed': the event fires but the callback returns an object without the new center location:
{"id":0,"type":"circle"}

re 'radius_changed':  the event fires but the callback returns an object without the new radius:
{"id":0,"type":"circle"}

re "DARKMAP": still no change, the map loads in the default map type.

Thanks again for your support!
WT

ECEisLife

unread,
Dec 18, 2021, 7:25:20 PM12/18/21
to DroidScript
Hi wheelie

The  center_changed and  radius_changed event as stated in the docs has no arguments. See docs here https://developers.google.com/maps/documentation/javascript/reference/polygon#Circle

But I will try to recreate it to pass the circle data to the callback.

As for the darkmap, have you tried map.SetMapTypeId('darkmap') on the map_OnReady callback?

Sorry for the late reply, due to Typhoon Odette there's a complete telco block out in our country in the past few days.

Regards

wheelie tips

unread,
Dec 19, 2021, 2:12:02 AM12/19/21
to DroidScript
Hi Jumar,
Thank you for your reply! no need for apologies, totally understood.
re center_changed and  radius_changed events: that could be awesome if you'll find the time for it!!
map.SetMapTypeId('DARKMAP') on the map_OnReady did the job, many thanks for pointing me there!
Thanks again for your support,
Keep safe,
Best,
WT 

wheelie tips

unread,
Jan 17, 2022, 9:13:13 AM1/17/22
to DroidScript
@Jumar,
 I'm trying to change the marker icon size, i tried to pass to the SetIcon this:
{url:'/img/example_img.png', size: [20, 32]}

but that leads to getting the map's default red marker, so I've tried to pass to the SetIcon this (without size):
{url:'/img/example_img.png'}

that was also ignored and I was getting the default marker instead of the desired image.
Can you please let me know how to change the custom marker image size?

Many thanks in advance!
WT

wheelie tips

unread,
Jan 18, 2022, 3:32:52 AM1/18/22
to DroidScript
digging a bit under the hood it seems that the SetIcon adds a default scaledSize:
Web.Execute(♀markers[1].SetIcon('{"url":"Img/usersImage/a1/a1.png","scaledSize":{"width":40,"height":40}...)

is there any way to set those width/height values?

wheelie tips

unread,
Jan 19, 2022, 11:18:34 AM1/19/22
to DroidScript
meanwhile, had another issue when trying to add a button in an infoWindow; based on this working example. when using this:
'<button onclick="myFunction()">Click me</button>'
the infoWindow won't be shown

removing the quotation marks:
'<button onclick=myFunction()>Click me</button>'

the infoWindow is shown with the button but the click event does not fire.

Alan Hendry

unread,
Jan 19, 2022, 12:34:38 PM1/19/22
to DroidScript
HI,
I think it's supposed to take your info window and wrap it in a div with a green background
(warning - I'm just typing this here, so there may be typos, etc)
First I'd probably try to establish if the onclick is working at all onclick="alert(1)"
Then move on slightly using your onclick but simplify function myFunction() {alert(2);}
Next check if infowindow is there, function myFunction() {alert(infowindow.nodeType);}
Finally try getContent() function myFunction() {alert( infowindow.getContent() );}
Regards, ah

Jumar

unread,
Jan 19, 2022, 11:10:54 PM1/19/22
to DroidScript
Hi there Wheelie. Can you send me a direct message. Maybe you could try the newer version which covers these issues you raised. As part of the growing list of MapView V1.09 released which I'm trying to complete.

Regards

wheelie tips

unread,
Jan 20, 2022, 2:38:21 AM1/20/22
to DroidScript
Hi Allan, 
Thanks much for your suggestions.
Unfortunately its failing right off the gate when trying  onclick="alert(1)", I've DM Jumar and I trust his latest update covers that too.
Thx again,
WT

wheelie tips

unread,
Jan 20, 2022, 12:31:39 PM1/20/22
to DroidScript
@Jumar - I can't thank you enough!! once again you have proven your professionalism and your commitment to your development - I commend you on your work and dedication!

Both Icon size and click events work flawlessly!!

infoWindow.png

wheelie tips

unread,
Jan 21, 2022, 7:17:06 AM1/21/22
to DroidScript
Hi, following the use of MapView ver 1.09, specifically infoWindow.AddListener closeclick
I try to recapture the infoWIndow close event and under the new version it requires to pass an ID, I was looking at the close button source but it seems it doesn't use an ID tag (or I didn't find one):

closeButton.png

so the question is what to pass to the AddListener command: 
infoWindow.AddListener( "closeclick", "InfoWindowClose", "???????")

or perhaps it is not the correct way to achieve it?

Thanks & Best,
WT

wheelie tips

unread,
Jan 22, 2022, 4:14:01 AM1/22/22
to DroidScript
@Jumar,
The latest version captures the events, many thanks for your quick support!
All the best,
WT


wheelie tips

unread,
Feb 24, 2022, 3:03:36 AM2/24/22
to DroidScript
I've encountered a strange error when creating an Absolute layout when clicking a marker from the map and calling the SetPosition command for that layout; the code is very simple:

the marker part:
myMarker = map.CreateMarker(0, 0, true)
var myMarkerGreen       = "Img/green_map_marker_static.png"
myMarker.AddListener("click", "Show_Marker_Floating_Buttons")
/////////////////////////////////////////////////////////////

function Show_Marker_Floating_Buttons()
{    
    lay_Contact_Member = app.CreateLayout("Absolute")
    lay_Contact_Member.SetBackColor('yellow')
    lay_Contact_Member.SetPosition(0.7, 0.3, 0.3, 0.6)
    lay_Contact_Member.SetOnTouch(moveIt)
    //Add layout to app.
    app.AddLayout( lay_Contact_Member )
}

function moveIt()
{
    lay_Contact_Member.SetPosition(0.7, 0.3, 0.3, 0.6)  
}/////////////////////////////////////////////////////////////

when running the SetPosition in the Show_Marker_Floating_Buttons() it does the resizing of the layout but ignores the position part, when calling moveIt() in the IDE debug it shows:

  • App.CreateLayout( Absolute )
  • -> #3
  • Lay.SetBackColor( yellow )
  • Obj.SetPosition( 0.7, 0.3, 0.3, 0.6, )
  • Lay.SetOnTouch( moveIt )
  • App.AddLayout( #3 )
  • Obj.SetPosition( 0.7, 0.3, 0.3, 0.6, )
  • WARNING: Obj.SetPosition() failed! (SetPosition only works in Absolute layouts!)
and in the adb output:
02-24 09:46:55.689 14915 14915 D Nxt     :  ->
02-24 09:46:55.691 14915 14915 D Nxt     : Web.Execute(♀CreateMarker('{"position":{"lat":0,"lng":0},"id":0}')♀null)
02-24 09:46:55.691 14915 14915 D Nxt     :  ->
02-24 09:46:55.693 14915 14915 D Nxt     : Web.Execute(♀markers[0].setMap(map)♀null)
02-24 09:46:55.693 14915 14915 D Nxt     :  ->
02-24 09:46:55.696 14915 14915 D Nxt     : Web.Execute(♀markers[0].SetIcon('{"url":"Img/green_map_marker_static.png","scaledSize":{"width":40,"height":40}}')♀null)
02-24 09:46:55.696 14915 14915 D Nxt     :  ->
02-24 09:46:55.699 14915 14915 D Nxt     : Web.Execute(♀markers[0].SetPosition('{"lat":0,"lng":0}')♀null)
02-24 09:46:55.700 14915 14915 D Nxt     :  ->
02-24 09:46:55.702 14915 14915 D Nxt     : Web.Execute(♀markers[0].AddEvent('click', 'Show_Marker_Floating_Buttons', 0)♀null)
02-24 09:46:55.702 14915 14915 D Nxt     :  ->
02-24 09:46:55.704 14915 14915 D Nxt     : Web.Execute(♀map.PanTo('{"lat":0,"lng":0}')♀null)
02-24 09:46:55.705 14915 14915 D Nxt     :  ->
02-24 09:46:55.905 14915 14915 D Nxt     : _UseDbg(♀false)
02-24 09:46:56.908 14915 14915 D Nxt     : _UseDbg(♀false)
02-24 09:46:58.260 14915 14915 D Nxt     : App.Execute(Show_Marker_Floating_Buttons('{"latLng":{"lat":0,"lng":0},"domEvent":{"isTrusted":true,"__gm_interna...)
02-24 09:46:58.261 14915 14915 D Nxt     : Executing statement...
02-24 09:46:58.266 14915 14915 D Nxt     : App.CreateLayout(Absolute♀undefined)
02-24 09:46:58.268 14915 14915 D Nxt     : Object Count = 4
02-24 09:46:58.268 14915 14915 D Nxt     :  -> #3
02-24 09:46:58.270 14915 14915 D Nxt     : Lay.SetBackColor(♀yellow)
02-24 09:46:58.271 14915 14915 D Nxt     : Obj.SetPosition(♀0.7♀0.3♀0.3♀0.6♀undefined)
02-24 09:46:58.273 14915 14915 D Nxt     : Lay.SetOnTouch(♀moveIt)
02-24 09:46:58.274 14915 14915 D Nxt     : App.AddLayout(#3)
02-24 09:47:01.067 14915 14915 D Nxt     : Firing activity event _Call('#3',moveIt,[{source:_map[\"#3\"],action:\"Down\",count:1,X:0.59488934,Y:0.8657014,screenX:0.1784668,screenY:0.5539675,rawX:192.74414,rawY:1208.2031,x:[0.59488934,0.0,0.0],y:[0.8657014,0.0,0.0]}])
02-24 09:47:01.071 14915 14915 D Nxt     : Obj.SetPosition(♀0.7♀0.3♀0.3♀0.6♀undefined)
02-24 09:47:01.072 14915 14915 E Nxt     : ------ ERROR: Script method failed ------
02-24 09:47:01.072 14915 14915 E Nxt     : java.lang.Exception: SetPosition only works in Absolute layouts!
02-24 09:47:01.072 14915 14915 E Nxt     :      at com.smartphoneremote.ioioscript.IOIOScript.L(Unknown Source:15)
02-24 09:47:01.072 14915 14915 E Nxt     :      at com.smartphoneremote.ioioscript.ChromeClient.onJsPrompt(Unknown Source:18398)
02-24 09:47:01.072 14915 14915 E Nxt     :      at n9.run(chromium-TrichromeWebViewGoogle6432.aab-stable-475810134:7)
02-24 09:47:01.072 14915 14915 E Nxt     :      at android.os.Handler.handleCallback(Handler.java:938)
02-24 09:47:01.072 14915 14915 E Nxt     :      at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 09:47:01.072 14915 14915 E Nxt     :      at android.os.Looper.loopOnce(Looper.java:226)
02-24 09:47:01.072 14915 14915 E Nxt     :      at android.os.Looper.loop(Looper.java:313)
02-24 09:47:01.072 14915 14915 E Nxt     :      at android.app.ActivityThread.main(ActivityThread.java:8582)
02-24 09:47:01.072 14915 14915 E Nxt     :      at java.lang.reflect.Method.invoke(Native Method)
02-24 09:47:01.072 14915 14915 E Nxt     :      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:563)
02-24 09:47:01.072 14915 14915 E Nxt     :      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
02-24 09:47:01.094 14915 14915 D Nxt     : Firing activity event _Call('#3',moveIt,[{source:_map[\"#3\"],action:\"Move\",count:1,X:0.5995565,Y:0.8657014,screenX:0.17986694,screenY:0.5539675,rawX:194.2563,rawY:1208.2031,x:[0.5995565,0.0,0.0],y:[0.8657014,0.0,0.0]}])

Thanks much in advance,
Best,
WT

Alan Hendry

unread,
Feb 24, 2022, 7:03:31 AM2/24/22
to DroidScript
HI,
It looks like  lay_Contact_Member  is a "top level" layout - app.AddLayout( lay_Contact_Member )
AFAIK, Controls (including layouts) have to be inside an absolute layout to be placed by setposition.
You could try adding layer2 inside lay_Contact_Member setposition of layer2, 
put your controls on layer2.
Regards, ah

wheelie tips

unread,
Feb 24, 2022, 7:16:47 AM2/24/22
to DroidScript
Hi Allan - thank you for your reply.
instead of app.AddLayout I add the lay_Contact_Member as a child to the layout that holds the map and that did the trick!
Many thanks!!
WT

wheelie tips

unread,
Mar 5, 2022, 3:28:15 AM3/5/22
to DroidScript
Hi,
I'm trying to hide business markers by setting styles to the map once in the Map_OnReady:

const styles = {
        featureType: "poi.business",
        elementType: "all",
        stylers: [ { visibility: "off" } ]
    }

map.SetOptions ({zoomControl:false, styles:styles})
////////////////////////////////////////////////////////////////////////

although the zoom control is not visible the business markers stay visible; can you pls point me on how to implement the style correctly?

Jumar

unread,
Mar 5, 2022, 9:37:08 PM3/5/22
to DroidScript
Hi Wheelie

The docs says styles should be an array of MapTypeStyle

Can you try this

const styles = {
        featureType: "poi.business",
        elementType: "all",
        stylers: [ { visibility: "off" } ]
    }
map.SetOptions ( { zoomControl: false, styles: [ styles ] } )

I never tried to run this code snippet by the way.

Regards
Jumar

wheelie tips

unread,
Mar 6, 2022, 2:08:44 AM3/6/22
to DroidScript
Good morning Jumar, 

Thank you for your reply!
Unfortunately, that didn't work also..

wheelie tips

unread,
Mar 10, 2022, 4:23:38 AM3/10/22
to DroidScript
@Jumar, I've tried without any success to change the map's style, would it be possible for you to test it from your end?
Best,
WT

Jumar

unread,
Mar 10, 2022, 6:54:53 PM3/10/22
to DroidScript
Hi Wheelie

I will update you regarding this matter as soon as I can make it to work

Regards

wheelie tips

unread,
Mar 11, 2022, 2:36:53 AM3/11/22
to DroidScript
Thank you, waiting for your update.
WT

Jumar

unread,
Mar 11, 2022, 3:30:05 AM3/11/22
to DroidScript
Hi Wheelie

This works on my end.

map.SetOptions( {
        styles: [
            {
                featureType: "poi",

                elementType: "all",
                stylers: [{ visibility: "off" } ]
            },
            {
                featureType: "transit",

                elementType: "all",
                stylers: [{ visibility: "off" } ]
            },
        ]
    })

Can you try it on your end. poi.business should work also. Maybe you are referencing the wrong featureType. See here for the available values.


I don't really know each type. So what I did is try all featureType and run. You should then have a clue of the featureType you are concern with.

Regards
Jumar

wheelie tips

unread,
Mar 11, 2022, 4:42:05 AM3/11/22
to DroidScript
so I copied your code to my Map_OnReady() and there was no change in the map; I looked if I use map.SetOptions elsewhere and I don't, then I tried to disable the:
map.SetMapTypeId('DARKMAP')

and the style did work! so there's a problem when using map.SetOptions and setting the map.SetMapTypeId('DARKMAP').

so the question is how to use a darkmap with styles?

Jumar

unread,
Mar 11, 2022, 9:16:20 PM3/11/22
to DroidScript
Hi Wheelie

Here's a complete style set you can apply to recreate the darkmap and add the poi.business styler

map.SetOptions( {
styles: [
        {elementType: 'geometry', stylers: [{color: '#242f3e'}]},
        {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},
        {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},
        {
            featureType: 'administrative.locality',
            elementType: 'labels.text.fill',
            stylers: [{color: '#d59563'}]
        },
        {
            featureType: 'poi',
            elementType: 'labels.text.fill',
            stylers: [{color: '#d59563'}]
        },
        {
            featureType: 'poi.park',
            elementType: 'geometry',
            stylers: [{color: '#263c3f'}]
        },
        {
            featureType: 'poi.park',
            elementType: 'labels.text.fill',
            stylers: [{color: '#6b9a76'}]
        },
        {
            featureType: 'road',
            elementType: 'geometry',
            stylers: [{color: '#38414e'}]
        },
        {
            featureType: 'road',
            elementType: 'geometry.stroke',
            stylers: [{color: '#212a37'}]
        },
        {
            featureType: 'road',
            elementType: 'labels.text.fill',
            stylers: [{color: '#9ca5b3'}]
        },
        {
            featureType: 'road.highway',
            elementType: 'geometry',
            stylers: [{color: '#746855'}]
        },
        {
            featureType: 'road.highway',
            elementType: 'geometry.stroke',
            stylers: [{color: '#1f2835'}]
        },
        {
            featureType: 'road.highway',
            elementType: 'labels.text.fill',
            stylers: [{color: '#f3d19c'}]
        },
        {
            featureType: 'transit',
            elementType: 'geometry',
            stylers: [{color: '#2f3948'}]
        },
        {
            featureType: 'transit.station',
            elementType: 'labels.text.fill',
            stylers: [{color: '#d59563'}]
        },
        {
            featureType: 'water',
            elementType: 'geometry',
            stylers: [{color: '#17263c'}]
        },
        {
            featureType: 'water',
            elementType: 'labels.text.fill',
            stylers: [{color: '#515c6d'}]
        },
        {
            featureType: 'water',
            elementType: 'labels.text.stroke',
            stylers: [{color: '#17263c'}]
        },

        {
            featureType: "poi.business",
            elementType: "all",
            stylers: [ { visibility: "off" } ]
        }
    ]
})

Regards
Jumar

wheelie tips

unread,
Mar 12, 2022, 1:54:44 AM3/12/22
to DroidScript
Thank you, That works!!
WT

wheelie tips

unread,
Mar 19, 2022, 5:41:00 AM3/19/22
to DroidScript
Hi Jumar,
Can you pls let me know if the plugin supports the builtin function that checks if a point is inside a polygon - containsLocation?  
Cheers!
WT

wheelie tips

unread,
Mar 19, 2022, 7:38:08 AM3/19/22
to DroidScript
Another question re: working with Polygons, when adding a polygon that is editable to the map, once the user has finished settings the polygon's  new shape, the app needs to get the final polygon path; when implemented the GetPath(callback) I couldn't get the callback to fire; I've tried setting the callback in two different ways:

newPolygon.GetPath('newPolygon_GetPath') // doesnt call the function newPolygon_GetPath (e)

and also calling the following function 
function getNewPolygonPath()
{
    newPolygon.GetPath(function (e)
    {
        console.log(">>>>> getNewPolygonPath" )  // never fire
        console.log(">>>>> " + e)
    })
}

the debug output is the same for both ways:
03-19 13:12:28.753 11217 11217 D Nxt     : Web.Execute(♀CreatePolygon('{"path":[{"lat":10.005,"lng":10},{"lat":10,"lng":10.005},{"lat":9.995,"lng":10},{"lat":10,"lng":9.99...)
03-19 13:12:28.754 11217 11217 D Nxt     :  ->
03-19 13:12:28.756 11217 11217 D Nxt     : Web.Execute(♀polygons[1].setMap(map)♀null)
03-19 13:12:28.756 11217 11217 D Nxt     :  ->
03-19 13:12:28.757 11217 11217 D Nxt     : Web.Execute(♀polygons[1].setEditable(true)♀null)
03-19 13:12:28.757 11217 11217 D Nxt     :  ->
03-19 13:12:38.211 11217 11217 D Nxt     : Firing activity event _Call('#3',getNewPolygonPath,[])
03-19 13:12:38.216 11217 11217 D Nxt     : Web.Execute(♀polygons[1].Get('getPath')♀null)
03-19 13:12:38.217 11217 11217 D Nxt     :  ->

can you please let me know what is it I'm missing here?
Looking forward to your much-appreciated support!
WT

BTW - regarding my earlier question re containsLocation, I'm currently using point-in-polygon to figure out whether the point is in or out of a polygon, its not ideal as the data structure is different than the one we use for the map so I have to have two copies of the same data in different structures, but as I said, I have a working solution.

wheelie tips

unread,
Mar 22, 2022, 3:28:14 AM3/22/22
to DroidScript
Hi,  I've tried everything I can think of in the last few days to get the polygon edited path without success, I think I'm implementing the command correctly but it is broken IMHO,  any chance of fixing this?
Many thanks in advance!
WT

Alan Hendry

unread,
Mar 22, 2022, 8:30:55 AM3/22/22
to DroidScript
HI,
I know very little about MapView (so take this with a generous pinch of salt)
Normally in DS the callback function is not in apostrophes or quotes
   newPolygon.GetPath(newPolygon_GetPath)
Regards, ah

wheelie tips

unread,
Mar 22, 2022, 9:28:42 AM3/22/22
to DroidScript
thx Alan, in his plugin a lot of the callbacks are set as a string, for example from the plugin docs:
A very usefull method of the marker object.
'event' and 'callback' parameter is a string

nevertheless, I obviously tried to pass it not as a string too... no joy :(

Jumar

unread,
Mar 22, 2022, 12:29:32 PM3/22/22
to DroidScript

Hi there Wheelie

Sorry for the late reply

I just sent you an email to cater a portion of this issue.

It seems like GetPath can't be used when the polygon is modified. I searched on the internet and found out this issue here
I will try to solve this problem and will probably update you soon. Some folks out there, uses insert_at and set_at thing to solve this matter.

BTW: You can use polygon.GetPath( myFunction ), passing the function name as it is and not as a string in GetPath and GetPaths

Thank you for pointing issues on MapView plugin. It really helps a lot to fins some issues like this not only to MapView plugin but to the Google Map SDK as a whole.

Regards
Jumar

wheelie tips

unread,
Mar 23, 2022, 4:00:39 AM3/23/22
to DroidScript

Good morning Jumar,

 Thank you for the updated plugin!

 After a couple of hours of testing, here are my findings:

 When creating a new polygon and setting GetPath and SetEditable(true) :

 newPolygon = map.CreatePolygon(path, "#009688", 0.1, 5, "#009688", true)
newPolygon.GetPath(newPolygon_GetPath)
newPolygon.SetEditable(true) 

function newPolygon_GetPath( e )
{
    console.log(">> newPolygon_GetPath = " + e)
    app.WriteFile('poly.json', JSON.stringify(e))
}

 The callback function “newPolygon_GetPath” is fired only once on the creation; from that moment on, the callback is not fired anymore.

Trying to set newPolygon.SetEditable(false) and then set the callback newPolygon.GetPaths(newPolygon_GetPath) after finishing editing the new polygon also doesn’t fire the callback.

I couldn’t addListener to the polygon path as they did in your link.

I’ve also tried to addListener to the polygon mouseup which did fire whenever a point on the edited polygon changed, but the callback returned only the latlng of that point (I tried to add those points to an array but if the user changes the same point twice, it causes differences between the array and the true polygon array )

If I understand correctly the problem is there’s an issue with getting the path of the polygon while editing it; this is not our need; we need to get the final path array of the edited polygon after the editing part has ended; so the question is how to get an existing polygon point array after it was edited and is no longer in edit mode?

Thanks again for taking the time to look into this issue, looking forward to solving this!!

Best,
WT

wheelie tips

unread,
Apr 2, 2022, 5:04:50 AM4/2/22
to DroidScript
in my ongoing quest to be able to get an edited polygon path array from the map, I've looked into the drawingManager, specifically on the 'overlaycomplete' event, and found in StackOverflow the following code:
maps.event.addListener(drawingManager, 'polygoncomplete', function(polygon) { console.log("new polygon is", polygon); });

I've tried to add a listener to the map for 'polygoncomplete' but it doesn't fire; 

any thought on how to get the 'polygoncomplete' event to fire? it seems like an alternative to the GetPath that fires only once on creation.
Looking forward to your support.
WT

PS - greetings on adding MapView as part of the premium package!!



Alan Hendry

unread,
Apr 3, 2022, 1:34:17 PM4/3/22
to DroidScript

wheelie tips

unread,
Apr 3, 2022, 5:15:05 PM4/3/22
to DroidScript
there's defiantly an issue with this; nevertheless, we still looking for a solution to get the final polygon path once it was added and edited, the GetPath function works in JS, for example, from the Google Maps API v3 group it is called for example yourPolyLine.getPath().getArray();  

the GetPath() function works in JS API v3, a working example can be seen with the code below (just add your Goggle API key):
poly.png
<html>
<head>
    <title>Google Maps Draw Polygon Get Coordinates</title>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR-KEY"></script>
    <script type="text/javascript">
        var draggablePolygon; function InitMap() {
            var location = new google.maps.LatLng(28.620585, 77.228609);
            var mapOptions = {
                zoom: 7,
                center: location,
                mapTypeId: google.maps.MapTypeId.RoadMap
            };
            var map = new google.maps.Map(document.getElementById('map-canvas'),
                mapOptions);
            var shapeCoordinates = [
                new google.maps.LatLng(28.525416, 79.870605),
                new google.maps.LatLng(27.190518, 77.530518),
                new google.maps.LatLng(29.013807, 77.67334)
            ];
            // Construct the polygon
            draggablePolygon = new google.maps.Polygon({
                paths: shapeCoordinates,
                draggable: true,
                editable: true,
                strokeColor: '',
                strokeOpacity: 0.8,
                strokeWeight: 2,
                fillColor: '#ADFF2F',
                fillOpacity: 0.5
            });
            draggablePolygon.setMap(map);
            google.maps.event.addListener(draggablePolygon, "dragend", Getpolygoncoordinates);
            google.maps.event.addListener(draggablePolygon.getPath(), "insert_at", Getpolygoncoordinates);
            google.maps.event.addListener(draggablePolygon.getPath(), "remove_at", Getpolygoncoordinates);
            google.maps.event.addListener(draggablePolygon.getPath(), "set_at", Getpolygoncoordinates);
        }
        function Getpolygoncoordinates() {
            var len = draggablePolygon.getPath().getLength();
            var strArray = "";
            for (var i = 0; i < len; i++) {
                strArray += draggablePolygon.getPath().getAt(i).toUrlValue(5) + "<br>";
            }
            document.getElementById('info').innerHTML = strArray;
        }
    </script>
</head>
<body onload="InitMap();Getpolygoncoordinates();">
    <h2>Google Maps Draw Polygon Get Coordinates - Demo</h2>
    <div id="map-canvas" style="height: 400px; width: auto;"></div>
    <h4>Updated Coordinates (X,Y)</h4>
    <div id="info" style="position:absolute; color:red; font-family: Arial; height:200px; font-size: 12px;"></div>
</body>
</html>
//////////////////////////////////////////////////////////////

in that example, it's a workaround to get the polygon path while editing, that is way more than what we need, if there was a way to do what the 'Getpolygoncoordinates' function does after the polygon was reshaped and is no longer in edit mode is more than enough; the issue is that in the plugin the GetPath value returns as a callback function and that callback is fired only once on creation, whether the polygon is edited or not; calling the GetPath once the polygon was created, that is after the first time the callback fired, from that moment on we couldn't get the callback to fire again.

Erez Mor

unread,
Apr 9, 2022, 4:16:34 AM4/9/22
to DroidScript
Thank you for this PREMIUM plugin! It is an excellent addition to DS.
I’ve started using it and encountered the same problem with the GetPath for polygon.
is there anyone who knows how to solve this?

cheers

wheelie tips

unread,
Apr 10, 2022, 3:38:00 AM4/10/22
to DroidScript
BTW - GetPath does work with Polyline as it should but not with Polygon in the current plugin version.
we hope this issue will be resulved soon.

wheelie tips

unread,
Apr 10, 2022, 10:05:54 AM4/10/22
to DroidScript
Hi,
encountered two issues re Marker:
  1. marker SetIcon cannot load images located at the root folder; the marker itself doesn't show without any error msg, same icon would be shown if located in the Img folder for ex.
  2. marker SetOptions seems to be broken, trying to format a label breaks the marker and it doesn't show, for ex.:
    myMarker.SetOptions({color: "#eb3a44",fontSize: "44px",fontWeight: "bold"}) // I guess this is the correct way but not 100% sure

Best,
WT

wheelie tips

unread,
Apr 11, 2022, 1:58:46 AM4/11/22
to DroidScript
Hi,
Is the "map.FindPlaceByTextQuery" equivalent to Google API "nearbysearch"? if it does, then when query, for ex., a gas station in "Cathedral Square Birmingham" (52.48109315453335,-1.8989471566062308), the return callback has only two hits, and they out of 5K radius:

var query = "gas_station"
map.FindPlaceByTextQuery(query, 52.48109315453335, -1.8989471566062308, 5000, null, OnResult)

[{"geometry":{"location":{"lat":50.50259029999999,"lng":3.5882451}},"name":"Texaco","place_id":"ChIJm8YoISH7wkcR_G6B6hSAK3s"},{"geometry":{"location":{"lat":49.25805099999999,"lng":6.0839368}},"name":"Système U - Super U - Clouange","place_id":"ChIJFynLnJoolUcRZW0cNSE1Vv8"}]

when calling the nearbysearch API with the same search query, the return result has many accurate hits:


{ "html_attributions" : [], "results" : [ { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.47261, "lng" : -1.912134 }, "viewport" : { "northeast" : { "lat" : 52.4739864802915, "lng" : -1.910805019708498 }, "southwest" : { "lat" : 52.4712885197085, "lng" : -1.913502980291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Shell", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 4128, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/115729052093429292915\"\u003eابو سمیر\u003c/a\u003e" ], "photo_reference" : "Aap_uEBvrrx4LGtCfOHgLcfMyqdmya-Z3-8h_FCwenKrxis1EntYy_id3C_LqdaaJ4Juk24PqIrGUd8s3MjlcDeSBgZPbHhvkZA3Kjx_UTwhjcGjmXARf_OJHX9GVVlIuXgXcUxq_lAplFxeuRzwLkNPhw5YOjht6hcTG-9NOaO0q-FZIi4N", "width" : 2322 } ], "place_id" : "ChIJU9G8bF-8cEgRd-B_T9QaYbc", "plus_code" : { "compound_code" : "F3FQ+24 Birmingham, UK", "global_code" : "9C4WF3FQ+24" }, "price_level" : 2, "rating" : 3.7, "reference" : "ChIJU9G8bF-8cEgRd-B_T9QaYbc", "scope" : "GOOGLE", "types" : [ "gas_station", "atm", "car_wash", "convenience_store", "meal_delivery", "finance", "cafe", "food", "point_of_interest", "store", "establishment" ], "user_ratings_total" : 67, "vicinity" : "Bath Row, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4741262, "lng" : -1.9019196 }, "viewport" : { "northeast" : { "lat" : 52.4755304802915, "lng" : -1.900622269708498 }, "southwest" : { "lat" : 52.4728325197085, "lng" : -1.903320230291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "ESSO HOLLOWAY HEAD", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 4000, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/105895514027038507985\"\u003eRichard Grantham\u003c/a\u003e" ], "photo_reference" : "Aap_uEDZRbRwv9WA7TKg-LZdHfpD-i3I3sMxGzF34bFXa7g9duDkc_TM_fPEfTk4UaoH4gWWcthb_hIDvoyOwY-zBy6R1wrmJcnHgbjMhawEi6gTArqpsMFJ8r4WUz_V6-LDvJrlRjsRgEA-GxV4jONC-CHnKouxD6yw-WbNKSh3GWbgekrE", "width" : 6000 } ], "place_id" : "ChIJmZfjJ2C8cEgRI0LvGG5UqCQ", "plus_code" : { "compound_code" : "F3FX+M6 Birmingham, UK", "global_code" : "9C4WF3FX+M6" }, "rating" : 3.8, "reference" : "ChIJmZfjJ2C8cEgRI0LvGG5UqCQ", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 63, "vicinity" : "48-55 Holloway Head, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4887935, "lng" : -1.890851099999999 }, "viewport" : { "northeast" : { "lat" : 52.4901533802915, "lng" : -1.889546069708498 }, "southwest" : { "lat" : 52.48745541970851, "lng" : -1.892244030291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "ESSO EG ASTON WAY", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 3120, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/100973857704910216398\"\u003eBentley land\u003c/a\u003e" ], "photo_reference" : "Aap_uEBCUeTv5oz7BA8fITMMbAbaKCexlEY7n_njnRBfKbPJUoKu67jT7SDr06_LptmhFf6ad26BTADzMb51EpRm4J7JrxUSIo7KnC7lBK-M8WeMnj_c-Enp5oa1cKAzWYPc6tLjCqtxbZonqws3mlZbVpWB8x5xx0nQ8CSotAJZ5v9pYuo", "width" : 4160 } ], "place_id" : "ChIJY05RUJq8cEgR-xQDWcLmqSQ", "plus_code" : { "compound_code" : "F4Q5+GM Birmingham, UK", "global_code" : "9C4WF4Q5+GM" }, "rating" : 3.7, "reference" : "ChIJY05RUJq8cEgR-xQDWcLmqSQ", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 113, "vicinity" : "305 Corporation Street, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.49246929999999, "lng" : -1.898806899999999 }, "viewport" : { "northeast" : { "lat" : 52.4937726302915, "lng" : -1.897593769708498 }, "southwest" : { "lat" : 52.4910746697085, "lng" : -1.900291730291501 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Texaco", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 3000, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/101883614871967046675\"\u003eR _ _ _ _ k\u003c/a\u003e" ], "photo_reference" : "Aap_uEDEOBtKJXjWUnZ1Rb6-1NcKS4cM5qAxj5SPe1eXkC8_oIH7qqPUpEDYwPwg3ssrLfvNeax4ObSAR7zLHm0-3LbZMeOC1wfkURPrWPkL3AeaHoLcrESvnTUpbjYXdTxjySG29XxrjWTSHX7D7ZSph1xUKFxSrVkreA7V94G8NQOhMYHq", "width" : 4000 } ], "place_id" : "ChIJ6-Eji5a8cEgRX_xXksn6R4k", "plus_code" : { "compound_code" : "F4R2+XF Birmingham, UK", "global_code" : "9C4WF4R2+XF" }, "rating" : 3.9, "reference" : "ChIJ6-Eji5a8cEgRX_xXksn6R4k", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 117, "vicinity" : "Summer Lane, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.49169670000001, "lng" : -1.9151515 }, "viewport" : { "northeast" : { "lat" : 52.4931011302915, "lng" : -1.913678169708499 }, "southwest" : { "lat" : 52.4904031697085, "lng" : -1.916376130291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "JET", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 3024, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/114032069184129075014\"\u003esaplingessentialservices\u003c/a\u003e" ], "photo_reference" : "Aap_uECf5JyynvorCLThUNyoiY_lC9j3zRgHo0qFEBFQ9bqP8LMWGyToLkGHIegHRjmdoPo3bzkFDk_CR7wSPdYfeC1q5Z8CrMFhdMjBeV9nGfwE05qQaPkkrif2zTS5iRSLmqKxY3Z-UTT4rPeRYJawZ-dQKJZI1vY0d9Gpxj2QcQNwz2VB", "width" : 4032 } ], "place_id" : "ChIJaf0GNu-8cEgR8Ptz6wW_VYA", "plus_code" : { "compound_code" : "F3RM+MW Birmingham, UK", "global_code" : "9C4WF3RM+MW" }, "rating" : 3.6, "reference" : "ChIJaf0GNu-8cEgR8Ptz6wW_VYA", "scope" : "GOOGLE", "types" : [ "gas_station", "car_wash", "point_of_interest", "establishment" ], "user_ratings_total" : 55, "vicinity" : "Icknield Street, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.47836, "lng" : -1.87537 }, "viewport" : { "northeast" : { "lat" : 52.4795848802915, "lng" : -1.874173369708498 }, "southwest" : { "lat" : 52.4768869197085, "lng" : -1.876871330291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "bp", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 1920, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/109486595379479308264\"\u003eHaq Nawaz\u003c/a\u003e" ], "photo_reference" : "Aap_uEADRZyQKPKgj5GOicRw09L7UmLC_oyxLfiRVWsjjvt0_2Rk8j7DKoVpppYCuhR7pxrRulqelQAgfofj1dYrg43aBTJGeWROL8tNZef7iv_qfF--axbmWNmDX4nSkkFsBWVrbjJF5Ux6eMf8BPt_PgknfDSg05qUuhR3xdiVrZNQJe1E", "width" : 1080 } ], "place_id" : "ChIJ38lGv367cEgR33c2DPzo9uA", "plus_code" : { "compound_code" : "F4HF+8V Birmingham, UK", "global_code" : "9C4WF4HF+8V" }, "rating" : 3.8, "reference" : "ChIJ38lGv367cEgR33c2DPzo9uA", "scope" : "GOOGLE", "types" : [ "gas_station", "atm", "finance", "cafe", "restaurant", "food", "point_of_interest", "establishment" ], "user_ratings_total" : 87, "vicinity" : "Watery Lane Middleway, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4940366, "lng" : -1.9102984 }, "viewport" : { "northeast" : { "lat" : 52.4955312802915, "lng" : -1.908933269708498 }, "southwest" : { "lat" : 52.4928333197085, "lng" : -1.911631230291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Texaco", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 1275, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/101150339625922645867\"\u003eScalp Doctor\u003c/a\u003e" ], "photo_reference" : "Aap_uEDLGun3OpzbkKrIXGwE-15-F05Be-zfQ_1kqhJojR2TiOkeq8I-B2m1G2zJfOiffHQliyIJ5C07w7T2p1VXWPOp-JCtOiViaylvLFbVnx5Qmb1CSWys6ZuEzsPzbuCK20ucTNEuwDbDd-lBTU4ubJTAO8peDVEZol6vLrSdy-3hvUgm", "width" : 1284 } ], "place_id" : "ChIJXyuXbuq8cEgR2F4RwOjqqQs", "plus_code" : { "compound_code" : "F3VQ+JV Birmingham, UK", "global_code" : "9C4WF3VQ+JV" }, "rating" : 4.1, "reference" : "ChIJXyuXbuq8cEgR2F4RwOjqqQs", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 55, "vicinity" : "New John Street West, Hockley, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4862103, "lng" : -1.9264885 }, "viewport" : { "northeast" : { "lat" : 52.48765253029149, "lng" : -1.925091969708498 }, "southwest" : { "lat" : 52.48495456970849, "lng" : -1.927789930291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "bp", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 944, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/113409854064642247063\"\u003earez sarhad\u003c/a\u003e" ], "photo_reference" : "Aap_uEByS8F8rQmuUlO5v9UwxlIyL6CFUr9raMcu4mMSGCdKe03pq-5r1R_sXRB_miHYbre0giGvdG3x86RCP1zX3xkM2w48PH8nWOe0rPnrSVkRcb1SL2NG3k_dHniclO_XiUR_XuuhkoGy6er_FOodQ8Bdl1uz9Llm4tIIb_sInzZtY2GT", "width" : 1280 } ], "place_id" : "ChIJaSKw6-S8cEgReQO5VfMSUUA", "plus_code" : { "compound_code" : "F3PF+FC Birmingham, UK", "global_code" : "9C4WF3PF+FC" }, "rating" : 4.7, "reference" : "ChIJaSKw6-S8cEgReQO5VfMSUUA", "scope" : "GOOGLE", "types" : [ "gas_station", "atm", "finance", "restaurant", "food", "point_of_interest", "establishment" ], "user_ratings_total" : 12, "vicinity" : "Spring Hill, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4991625, "lng" : -1.9089216 }, "viewport" : { "northeast" : { "lat" : 52.5004480302915, "lng" : -1.907507969708498 }, "southwest" : { "lat" : 52.4977500697085, "lng" : -1.910205930291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "ESSO HOCKLEY", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 3000, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/114621811455281438946\"\u003eAshraf Alam\u003c/a\u003e" ], "photo_reference" : "Aap_uEA61AUVpRQgGAEJU8i3AOQAvo0gKfiWQF307jqeZCEAADyHbVtHtCA06STnbQl7KfyFlc98fZ7fSsVU6kgPXgiTdiZW5uOb3MiFm8Xe2s1t0v7ioHsvLUJM5tLEgxVuOwbzsQ4iJBNMfXsJlbMwvksdgrQK57Th-VypdModo5uDHwJz", "width" : 4000 } ], "place_id" : "ChIJ0wc1lcC8cEgRm3hjB7VQfpk", "plus_code" : { "compound_code" : "F3XR+MC Birmingham, UK", "global_code" : "9C4WF3XR+MC" }, "rating" : 4.1, "reference" : "ChIJ0wc1lcC8cEgRm3hjB7VQfpk", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 36, "vicinity" : "93-99 Nursery Road, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4765634, "lng" : -1.8973833 }, "viewport" : { "northeast" : { "lat" : 52.4779109302915, "lng" : -1.895925619708498 }, "southwest" : { "lat" : 52.4752129697085, "lng" : -1.898623580291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Flix bus", "place_id" : "ChIJn5gzpLe9cEgRs06c44_uz6M", "plus_code" : { "compound_code" : "F4G3+J2 Birmingham, UK", "global_code" : "9C4WF4G3+J2" }, "reference" : "ChIJn5gzpLe9cEgRs06c44_uz6M", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "vicinity" : "Norfolk House, 84-86 Smallbrook Queensway, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4740282, "lng" : -1.9022697 }, "viewport" : { "northeast" : { "lat" : 52.4754384302915, "lng" : -1.900770969708498 }, "southwest" : { "lat" : 52.4727404697085, "lng" : -1.903468930291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Harvest Energy", "place_id" : "ChIJc6BrgIq8cEgRBMIfPQpVQLo", "plus_code" : { "compound_code" : "F3FX+J3 Birmingham, UK", "global_code" : "9C4WF3FX+J3" }, "rating" : 3.9, "reference" : "ChIJc6BrgIq8cEgRBMIfPQpVQLo", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 7, "vicinity" : "Exeter House, Exeter Street, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.48851450000001, "lng" : -1.8994525 }, "viewport" : { "northeast" : { "lat" : 52.4898755302915, "lng" : -1.898065719708498 }, "southwest" : { "lat" : 52.4871775697085, "lng" : -1.900763680291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Murco", "place_id" : "ChIJR31JZpG8cEgRFUbULIZfnnM", "plus_code" : { "compound_code" : "F4Q2+C6 Birmingham, UK", "global_code" : "9C4WF4Q2+C6" }, "rating" : 3.9, "reference" : "ChIJR31JZpG8cEgRFUbULIZfnnM", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 8, "vicinity" : "United Kingdom" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4879281, "lng" : -1.9057423 }, "viewport" : { "northeast" : { "lat" : 52.4893170302915, "lng" : -1.904362169708498 }, "southwest" : { "lat" : 52.4866190697085, "lng" : -1.907060130291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "A1 Garages", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 2322, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/105339067048287570990\"\u003eMohammed Imran\u003c/a\u003e" ], "photo_reference" : "Aap_uEAjlwCSDEsdIzjEXKeu7jWuSEzfi81BxLCGElLA_Llm3UP-Mtg7y5aXp5Moel6gjja_kpXdt3QpR_XDIFCOZBwESGQ5d3AgsaynxvgvrphSmBHkh4pfoRktAr4lvvITrP7aTVjfEKfp3_c5BNc0-TSfABfP8FGat7fA3fvq2yZH8gm8", "width" : 4128 } ], "place_id" : "ChIJayXDL5O8cEgRLhkoyCohOD0", "plus_code" : { "compound_code" : "F3QV+5P Birmingham, UK", "global_code" : "9C4WF3QV+5P" }, "rating" : 3.5, "reference" : "ChIJayXDL5O8cEgRLhkoyCohOD0", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 57, "vicinity" : "110 Constitution Hill, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4924493, "lng" : -1.8987759 }, "viewport" : { "northeast" : { "lat" : 52.4937819802915, "lng" : -1.897415619708498 }, "southwest" : { "lat" : 52.4910840197085, "lng" : -1.900113580291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "M.p.k. Garages Limited", "place_id" : "ChIJVVUli5a8cEgRjW5HalZR8og", "plus_code" : { "compound_code" : "F4R2+XF Birmingham, UK", "global_code" : "9C4WF4R2+XF" }, "reference" : "ChIJVVUli5a8cEgRjW5HalZR8og", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "vicinity" : "90 Summer Lane, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.47266399999999, "lng" : -1.9121347 }, "viewport" : { "northeast" : { "lat" : 52.4739951802915, "lng" : -1.910772819708498 }, "southwest" : { "lat" : 52.4712972197085, "lng" : -1.913470780291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Petrol station", "place_id" : "ChIJsRw75GS9cEgRua7lWUPto3g", "plus_code" : { "compound_code" : "F3FQ+34 Birmingham, UK", "global_code" : "9C4WF3FQ+34" }, "rating" : 4.6, "reference" : "ChIJsRw75GS9cEgRua7lWUPto3g", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 9, "vicinity" : "123 Bath Row, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4837314, "lng" : -1.8789236 }, "viewport" : { "northeast" : { "lat" : 52.4851275302915, "lng" : -1.877643269708498 }, "southwest" : { "lat" : 52.4824295697085, "lng" : -1.880341230291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Gulf", "place_id" : "ChIJc8fsaX27cEgRkWHli8-jsao", "plus_code" : { "compound_code" : "F4MC+FC Birmingham, UK", "global_code" : "9C4WF4MC+FC" }, "rating" : 1.8, "reference" : "ChIJc8fsaX27cEgRkWHli8-jsao", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 4, "vicinity" : "Vauxhall Road Fuel Express Automat, 37 Vauxhall Road, Lawford Close, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.48625679999999, "lng" : -1.918812 }, "viewport" : { "northeast" : { "lat" : 52.48746633029149, "lng" : -1.917636069708498 }, "southwest" : { "lat" : 52.4847683697085, "lng" : -1.920334030291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Tesco Petrol Station", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 3120, "html_attributions" : [ "\u003ca href=\"https://maps.google.com/maps/contrib/108372418948376557266\"\u003eYT Nawad Studio\u003c/a\u003e" ], "photo_reference" : "Aap_uEALRXXNd6FrGmz7OV0wMqP_arN_Jfb8dS6Czcptd9ap7q15HXhktRfjS7DdcsD_TlmB6_yT1ElsuVhPegtcRBHtrLF8_9PlecE1C1qReZITVw9_MeAt8OHG_hegctyRJaUtMljnvlnIfeqWOx3HDL4PKPdkaSWgquoqPEPRsE8nx0Qm", "width" : 4160 } ], "place_id" : "ChIJYxHEYuW8cEgRhSJX292XUTM", "plus_code" : { "compound_code" : "F3PJ+GF Birmingham, UK", "global_code" : "9C4WF3PJ+GF" }, "rating" : 4.2, "reference" : "ChIJYxHEYuW8cEgRhSJX292XUTM", "scope" : "GOOGLE", "types" : [ "gas_station", "convenience_store", "supermarket", "grocery_or_supermarket", "food", "point_of_interest", "store", "establishment" ], "user_ratings_total" : 273, "vicinity" : "Camden Street, Hockley, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.4915771, "lng" : -1.9150753 }, "viewport" : { "northeast" : { "lat" : 52.4930555802915, "lng" : -1.913677469708498 }, "southwest" : { "lat" : 52.49035761970851, "lng" : -1.916375430291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "MRH Key Hill", "opening_hours" : { "open_now" : true }, "place_id" : "ChIJE6JyPu-8cEgRxUmXh-dy-SE", "plus_code" : { "compound_code" : "F3RM+JX Birmingham, UK", "global_code" : "9C4WF3RM+JX" }, "rating" : 1, "reference" : "ChIJE6JyPu-8cEgRxUmXh-dy-SE", "scope" : "GOOGLE", "types" : [ "gas_station", "convenience_store", "food", "point_of_interest", "store", "establishment" ], "user_ratings_total" : 1, "vicinity" : "Icknield Street, Birmingham" }, { "business_status" : "OPERATIONAL", "geometry" : { "location" : { "lat" : 52.476325, "lng" : -1.875628 }, "viewport" : { "northeast" : { "lat" : 52.47768298029149, "lng" : -1.874208519708498 }, "southwest" : { "lat" : 52.4749850197085, "lng" : -1.876906480291502 } } }, "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/gas_station-71.png", "icon_background_color" : "#909CE1", "icon_mask_base_uri" : "https://maps.gstatic.com/mapfiles/place_api/icons/v2/gas_pinlet", "name" : "Gulf", "opening_hours" : { "open_now" : true }, "place_id" : "ChIJzz_-F3-7cEgR5kmPtXrlynI", "plus_code" : { "compound_code" : "F4GF+GP Birmingham, UK", "global_code" : "9C4WF4GF+GP" }, "rating" : 2.3, "reference" : "ChIJzz_-F3-7cEgR5kmPtXrlynI", "scope" : "GOOGLE", "types" : [ "gas_station", "point_of_interest", "establishment" ], "user_ratings_total" : 4, "vicinity" : "Watery Lane Fuel Express Automat, 73 Watery Lane Middleway, Birmingham" } ], "status" : "OK" }

Best,
WT

wheelie tips

unread,
Apr 17, 2022, 7:21:44 AM4/17/22
to DroidScript
Hi,

is there any way to use the Google Maps API Extension with the MapView Plugin?

@Jumar - get well soon!
WT

wheelie tips

unread,
Apr 19, 2022, 1:30:07 AM4/19/22
to DroidScript
quick note - at the plugin docs, the create-rectangle is not found.

wheelie tips

unread,
Apr 19, 2022, 2:22:40 AM4/19/22
to DroidScript
Hi,

it seems that the  circle.GetBounds(circle_bounds) is broken and the return event is always null.

function circle_bounds( event )
{
    console.log(event)  
}

wheelie tips

unread,
Apr 19, 2022, 2:50:21 AM4/19/22
to DroidScript
Hi,
The CreateRectangle draws black rectangle regardless to its styling setup:
rec = map.CreateRectangle(bound, "#009688", 0.1, 2, "#009688");
rec.SetEditable(true)


Screenshot_20220419-094906.jpg

wheelie tips

unread,
Apr 19, 2022, 10:43:57 PM4/19/22
to DroidScript
Hi,
it seems that the circle.GetCenter(circle_center) is broken and the return event is always null (like the GetBounds).
Best,
WT

wheelie tips

unread,
Apr 23, 2022, 12:22:52 AM4/23/22
to DroidScript
Hi,
Does the 'geometry' library of Google maps is included in the plugin?
Best,
WT

Jumar

unread,
Apr 24, 2022, 7:43:51 PM4/24/22
to DroidScript
Hi Wheelie

Sadly the geometry library is not included in the plugin. If you really need it, maybe I'll put it in the ToDo List.

Regards
Jumar

wheelie tips

unread,
Apr 24, 2022, 9:37:36 PM4/24/22
to DroidScript
Hi Jumar,
The geometry lib is not a must as there are other libs that can be used instead to calculate "Spherical Geometry" such as TURF, Leaflet and more; I wouldn't bother with it anytime soon.
Cheers,
WT 

wheelie tips

unread,
Apr 25, 2022, 12:34:18 AM4/25/22
to DroidScript
Hi,
when trying to SetOption to style a polygon it doesn't apply as it does to polyline, for example, the same line style was to both polyline and polygon:

const lineSymbol = { path: 'M 0,-1 0,1', strokeOpacity: 100, strokeWeight: 1, scale: 4 }
border = JSON.parse(app.ReadFile(' border.json'))
polygon  = map.CreatePolygon( border  , "#009688", 0.0001, 2, "#FF0000", true)
polygon.SetOptions({icons: [{icon: lineSymbol, offset: '0', repeat: '20px'}]})

const line = [{'lat':lat, 'lng':lng},{'lat':lat + 0.1, 'lng':lng + 0.1}]
polyBorder = map.CreatePolyline( line, null, '#EDFF14' )
polyBorder.SetOptions({icons: [{icon: lineSymbol, offset: '0', repeat: '20px'}]})
////////////////////////////////////////

the red line is the polygon and the yellow is the line, they both should have been dashed but only the polyline is, am I implementing it correctly?
Screenshot_20220425-072441.jpg

Erez Mor

unread,
Apr 26, 2022, 11:03:12 AM4/26/22
to DroidScript
hi there
Still stuck on it...Is there any update on the matter?

cheers,
Erez

Alan Hendry

unread,
Apr 26, 2022, 1:12:07 PM4/26/22
to DroidScript
HI,
Been years since I did this stuff, so take this with a pinch of salt
Not sure why the filename has a leading space  border = JSON.parse(app.ReadFile(' border.json'))
I expected to see M number number L number number (SVG path)  M 0 -1 L 0 1 
(possibly  m 0 -1 l 0 1 )
Regards, ah

wheelie tips

unread,
Apr 28, 2022, 12:44:51 AM4/28/22
to DroidScript
Hi Alan,
re name file, good catch however this is just a copy/paste issue to the post, the code itself loads and parses the JSON with no problem.
re lineSymbol, if there was an issue with it, it would have reflected in the yellow line as both the line and the polygon using the same style so I assume the problem is with the SetOption for the polygon and not the style itself.

wheelie tips

unread,
Apr 28, 2022, 4:43:08 AM4/28/22
to DroidScript
Hi,
how to set an anchor point to a custom marker (in my post from Apr 10, 2022, 5:05:54 PM I've noted that the SetOptions for markers seems broken so can't use that) ?
best,
WT

wheelie tips

unread,
Apr 28, 2022, 5:56:46 AM4/28/22
to DroidScript
hi, 
there's a problem with circle SetDraggable; when setting:
circle.SetEditable(true)
circle.SetDraggable(true)
the circle can be dragged and change its radius - works as should.

when setting:
circle.SetEditable(false)
circle.SetDraggable(true)
the circle can not be dragged and can change its radius - works as should.

when setting:
circle.SetEditable(true)
circle.SetDraggable(false)
the circle can be dragged and can change its radius - not work as should.

Alan Hendry

unread,
Apr 28, 2022, 1:07:08 PM4/28/22
to DroidScript
HI,
As far as I can remember M 0 -1 L 0 1 means move to co-ordinates 0,-1 then draw a line to 0,1
It's just possible that polyline interprets your version correctly it but polygon doesn't
Have you tried  M 0 -1 L 0 1  (M 0 -1 means move to co-ordinate 0,-1, L 0 1 means draw line to 0,1 ; M/L are absolute, m/l are relative) or m 0 -1 l 0 1

Symbol is a vector-based icon that can be displayed on a Marker or a Polyline object. 
(it doesn't mention polygons).
Regards, ah

wheelie tips

unread,
Apr 29, 2022, 2:56:24 AM4/29/22
to DroidScript
@Alan, thanks for your suggestion; unfortunately, setting the path to ' M 0 -1 L 0 1'  didn't change the result, I'm quite certain the problem is with the polygon's SetOptions.

Alan Hendry

unread,
Apr 29, 2022, 6:00:25 AM4/29/22
to DroidScript
HI,

You could try to modify other values in lineSymbol to see if the lineSymbol is being used at all in the Polygon.

https://developers.google.com/maps/documentation/javascript/shapes#maps_polyline_simple-javascript
has a section Customize a polyline (but not for polygon).  For polygons it says 
"You can define custom colors, weights, and opacities for the edge of the polygon (the stroke) and custom colors and opacities for the enclosed area (the fill)."
(n.b. no mention of symbols), and polyline options include icon, but polygon options don't. 
Regards, ah

wheelie tips

unread,
Apr 29, 2022, 11:59:09 AM4/29/22
to DroidScript
polygon seems to support that, have a look here.

Alan Hendry

unread,
Apr 29, 2022, 12:19:53 PM4/29/22
to DroidScript
HI,
So far I've been able to make dashed lines on google maps with the following code.
new google.maps.Polyline({
That all works fine, but is there a way that I can make a Polygon object with a dashed outline? I tried this, by it doesn't work
new google.maps.Polygon({

And the answer was 
I don't think you can. But you could overlay a Polyline on top of the Polygon.

Regards, ah

Jumar

unread,
Apr 29, 2022, 9:30:51 PM4/29/22
to DroidScript
Hi Wheelie

Google Maps API extension is not included on the list. As I look into the link you provided, I think it best way to support it on the plugin in the future.

Regards

Jumar

unread,
Apr 29, 2022, 10:22:38 PM4/29/22
to DroidScript
Hi Wheelie

I think you can't apply the dash line icon to polygon because PolygonOptions has no icons property.

Regards

wheelie tips

unread,
May 11, 2022, 5:20:03 AM5/11/22
to DroidScript

Hi Jumar,

The following are open issues/questions accumulated over the last couple of months, is there any estimated time, if any, for those issues to be addressed?  

newPolygon.GetPath
marker SetOptions
circle.GetBounds(circle_bounds)
circle.GetCenter(circle_center)
CreateRectangle
set an anchor point
circle SetDraggable

I really appreciate any help you can provide.
WT

Jumar

unread,
May 14, 2022, 10:42:34 PM5/14/22
to DroidScript
Hi Wheelie. If you are a DS premium you can install the new version from the DS Plugins Store.

Regards

Jumar

unread,
May 14, 2022, 10:45:00 PM5/14/22
to DroidScript
The new version also includes MarkerClusterer. See more at the docs section

Jumar

unread,
May 14, 2022, 10:50:00 PM5/14/22
to DroidScript
Hi Wheelie.

If you are not a DS premium user,  I sent you a direct link as the PlayStore update takes time to go live

Regards

wheelie tips

unread,
May 15, 2022, 2:07:35 AM5/15/22
to DroidScript
Hi Jumar.

Thank you for the latest update, I'm a premium member and I've updated to the latest version.

I wanted to go over the open issues I had but from the get-go, there's a problem with the Marker, it just doesn't show (the default marker, didn't try to set an icon), to make sure it's not my implementation I tried the "Show or hide a marker" example from the docs and the marker isn't visible there also.

Best,
WT

Blaine Smith

unread,
May 15, 2022, 4:59:27 PM5/15/22
to DroidScript
hoi

Jumar

unread,
May 17, 2022, 2:54:34 AM5/17/22
to DroidScript
Hi Wheelie

You can now download it again on the DS Plugins Store.

Sorry for the previous upload.

Regards

wheelie tips

unread,
May 17, 2022, 11:41:08 PM5/17/22
to DroidScript
Good morning Jumar,

Thank you for the updated plugin!

I've tested the latest ver 1:10 against the open issues and this is my findings, please let me know if i have missed anything:

newPolygon.GetPath - not fixed
marker.SetOptions -  not fixed
circle.GetBounds(circle_bounds) - FIXED!!
circle.GetCenter(circle_center)   FIXED!!
CreateRectangle  -  not fixed (also the link for it in the docs is broken)
set an anchor point  not fixed (i guess its part of the marker.SetOptions issue?)
circle.SetDraggable(false)  not fixed when circle.SetEditable(true)

Thanks again!
Best,
WT

wheelie tips

unread,
Jun 5, 2022, 4:01:11 AM6/5/22
to DroidScript
any updates on re-open issues? 

wheelie tips

unread,
Jun 15, 2022, 4:14:32 AM6/15/22
to DroidScript
Hi, I hate being this person but we truly need the newPolygon.GetPath to work in some way... any chance you'll get to it?
Thx again,
WT

Jumar

unread,
Jun 16, 2022, 5:22:42 AM6/16/22
to DroidScript
Hi Wheelie

Sorry for the inconvenience. Since google maps has not yet implemented the onPathChanged method on editable polygons and polylines I find a way to add this functionality through this thread https://spectrum.chat/react-google-maps/general/solved-what-is-the-right-approach-to-get-the-new-polygon-path-when-editing-a-polygon~06f0812d-fe63-4ca8-a7f9-721e3fbb0964. As for now I already have some progress but I need more time to integrate on the current setup in order not to break the mapview plugin as it is just a workaround on the feature.

I hope I can deliver it sooner than I expected.

Regards

Jumar

unread,
Jun 16, 2022, 10:02:52 PM6/16/22
to DroidScript
Hi

I updated the MapView plugin just now. You can install the latest plugin from DS Plugins Store section.

Update logs.
  • Fixed marker.SetOptions
  • Fixed polygon.GetPath for editable and draggable polygon
  • Fixed polyline.GetPath for editable and draggable polyline
  • Fixed broken rectangle docs link
Sample code for GetPath of polygon

app.LoadPlugin("MapView");
function OnStart() {
    lay = app.CreateLayout("Linear", "VCenter, FillXY");
       
        var apiKey = "AIzaSyD2eHntKEmh272p3ac6YjWPbPkwo3m2mck";
       
        map = app.CreateMapView(apiKey, 0.9, 0.5, 7.0689323, 125.6114588, 13);
        map.SetOnReady(MapOnReady);
        lay.AddChild(map);
   
        btn = app.AddButton( lay, "GetPath" )
        btn.SetOnTouch( function() {
            app.Alert( JSON.stringify( polygon.GetPath() ) )
        })
    app.AddLayout(lay);
}
function MapOnReady() {
    var path = [
        {lat: 7.069226, lng: 125.604101},
        {lat: 7.067352, lng: 125.608382},
        {lat: 7.070056, lng: 125.610388},
        {lat: 7.071771, lng: 125.607009}
    ];
    polygon = map.CreatePolygon(path, "#009688", 0.1, 2, "#009688");
    polygon.SetEditable( true )
}

Regards
Jumar

Jumar

unread,
Jun 16, 2022, 10:05:32 PM6/16/22
to DroidScript
polygon.GetPath is asynchronous. You can pass a callback or call it directly as it return the path array.

Example.

var newPath = polygon.GetPath()

This does not apply to GetPaths as GetPaths return and MVC array of MVC array. I will add this functionality to GetPaths as well in the future releases.

Regards
Jumar

wheelie tips

unread,
Jun 17, 2022, 1:07:20 AM6/17/22
to DroidScript
Good morning Jumar,

Thank you so very much for finding the time and fixing the GetPath issue, it works well now!

re Marker.SetOptions - it didn't work for me, I'm guessing I'm doing something wrong, for example:
myMarker.SetOptions({color: "#eb3a44",fontSize: "44px",fontWeight: "bold"})

Thanks again!
Best,
WT

Jumar

unread,
Jun 17, 2022, 4:25:08 AM6/17/22
to DroidScript
Hi Wheelie

Unfortunately, there is no color, fontSize and fontWeight props in Marker Options. See this link

Regards
Jumar

Jumar

unread,
Jun 17, 2022, 4:29:56 AM6/17/22
to DroidScript
Ahh okay I get it now. I think you are applying it to marker label. Try this.

var options = {
    label: { color: "#eb3a44",fontSize: "44px",fontWeight: "bold" }
}
myMarker.SetOptions( options )

Regards

Jumar

unread,
Jun 17, 2022, 4:37:27 AM6/17/22
to DroidScript
Here's an another example of a marker with text "A" color green

marker.SetOptions( { label: { color: "green", fontSize: "18px", fontWeight: "bold", text: "A" } } ) 

Regards
Jumar

wheelie tips

unread,
Jun 17, 2022, 5:20:09 AM6/17/22
to DroidScript
perfect!!!
Thx much.

wheelie tips

unread,
Aug 3, 2022, 6:38:02 AM8/3/22
to DroidScript
Hi,

How can one change the region and language when using the plugin?

Thanks in advance,
WT 

Jumar

unread,
Aug 6, 2022, 5:05:11 AM8/6/22
to DroidScript
Hi wheelie

Thank you for this. Will probably make this to the top of the todo list for the next release.

Regards
Jumar

wheelie tips

unread,
Aug 7, 2022, 2:13:48 AM8/7/22
to DroidScript
Thank you, looking forward to it!
It is loading more messages.
0 new messages