B4J Question [ABMaterial] AddMarkerEx()

Harris

Expert
Licensed User
Longtime User
How do I set the URL for a png file stored locally?

B4X:
' this one works - of course...
gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city ,  str, "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png",True )

' None of these do.  How do I set the URL for a file stored locally?

'            gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city ,  str, "http://localhost/"&File.DirApp&"/www/muniman/images/truck3.png",True )
'            gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city ,  str, "localhost"&"/www/muniman/images/truck3.png",True )
'            gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city ,  str, File.DirApp&"/www/muniman/images/truck3.png",True )
'            gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city ,  str, "../www/muniman/images/truck3.png",True )

gm1.AddMarkerEx("mk1"&i , l1, l2,locid &", "&city , str, "http://www.munmansys.com/www/muniman/images/truck3.png",True )

This works... However, I thought localhost may work as well - when developing...


Thanks
 
Last edited:

Harris

Expert
Licensed User
Longtime User
I'm not sure that is possible as I think the Google Api must be able to access it to build the map so it must be in a public place.
Ok, so I shall update my server to access the files when in dev. No big deal.

I get much overlap with Infomessage when GPS points are close to each other (naturally). Title would not be much better since it will not wrap.
The icon label (label.text) may reduce overlap if you could access it. I would only put small amounts of data on it ("45333","15:03").
That would reduce overlap significantly - and one could click the icon to get full infomessage data.

I know, there is only so much you can do with GM.

Thanks
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
God Dam Forest, your a GD genius...
That seemed to work!

I shall have to see when I load the entire project to the server that it continues to work.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
newmeetnow.jpg


With some strategic code, I can remove the overlap by not adding markers (for same vehicle) that are close in time or distance.
In this example, we are trying to determine where each vehicle is at NOW ( last data point received - show infomessage ).

To show history, restrict to One vehicle. Then you can show an uncluttered trail (with or without marker infomessage).

Like you say, there is only so much you can TRY to accomplish with GM, before it gets way too busy and you can't see anything!

I think we can make this work.

Thanks for your effort - as per usual. We are truly grateful to have your expert insight to simplify our dev goals. Try and find this kind of support ANYWHERE else in the world! (ok, Erel is exempt)...

Also, many, many thanks to all others that help AB make his project the best it can be.
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
I've been thinking the whole day on this problem. I may be able to build-in 'MarkerClusters'. When two markers become too close, they group together, showing the number of markers which are in the cluster. However, no extra info can be given to the cluster, nor can one set the color (it changes depending on the number of markers which are in the cluster). When the user clicks on such a cluster, it expands and then you can see the markers infoWindow. If this could be useful, let me know.

Example: (Note the numbers do not add-up but this is my fault)

GM1.png


GM2.png


GM3.png
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I was looking at that API yesterday but couldn't make sense of it.

In my situation, there may be several vehicles at the home yard (after work shift) that would cause an immediate overlap.
Another example is several vehicles waiting in a line up at a loading terminal.

I think they all flare when the image is clicked showing all in that group. Very Useful.
 
Upvote 0
Top