B4A Library GoogleMapsExtras

warwound

Expert
Licensed User
Longtime User

That's great that we have a solution, now i'll think of the best way to make the tile size into a property of the MapsforgeTileProviderOptions.
 

M6SOFT

Member
Licensed User
Longtime User
Hi,
I'm trying to work with wms server via CustomUrlTileProvider. All work great until i try this adress:
B4X:
http://integracja.gugik.gov.pl/cgi-bin/KrajowaIntegracjaEwidencjiGruntow?VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=powiaty,powiaty_obreby,ekw,regon,pesel,zsin,obreby,dzialki,geoportal,numery_dzialek,budynki&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=18.08074951171875,52.07781801208549,18.08349609375,52.079506003796965&styles=
This WMS server uses redirections and finally get image from:
B4X:
https://konin.geoportal2.pl/map/geoportal/wms.php?LAYERS=dzialki,budynki&REQUEST=GetMap&SERVICE=WMS&FORMAT=image/png&STYLES=,&HEIGHT=256&VERSION=1.1.1&SRS=EPSG:2180&WIDTH=256&BBOX=437022.374350923,468358.349568826,437212.163431718,468547.668771142&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_xml.
This second adress i see in browser after redirect from first - i think that there is more than one redirection.
Is it possible that CustomUrlTileProvider don't accept redirections?

Regards
 

M6SOFT

Member
Licensed User
Longtime User
Thank you for response. Very strange problem. I made more tests and i'm almost sure that problem comes from redirections or some weird WMS server configurations. Thanks again.
 

madru

Active Member
Licensed User
Longtime User
Morning, I need a littel hand here:

I am doing my 1st steps with the GoogleMapsExtras library and I ran prompt into a problem

assuming I draw a circle on the map like this:

B4X:
Dim co As CircleOptions
co.Initialize
co.Center2(0, 0).Radius(spnRadius.SelectedItem).FillColor(Colors.ARGB(90,158,0,255)).StrokeColor(Colors.ARGB(126,158,0,204)).StrokeWidth(3)
Dim Circle1 As Circle
Circle1 = gmapExtra.AddCircle(gmap, co)
Log(Circle1.Id) ' show me the circle id
Circle1.Remove ' remove the circle - redraw the map?
Log(Circle1.Id) ' should raise an exception as the circle is gone?

how can I remove the circle, using
B4X:
Circle1.Remove
does not work

can somebody explain what I am doing wrong or how to do it ?


THX
 

Daica

Active Member
Licensed User
@warwound
Hi,
Is it possible to customize the InfoWindow that is displayed? Like changing the color, border radius, etc.
Thank you!
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello
Why I cannot remove Circle? what is the code ? "gmapExtra.Remove" is wrong.
Thank you

Code:
Private gmapExtra As GoogleMapsExtras
Private co As CircleOptions

'Add Circle'
    co.Initialize
    co.Center2(Lati, Longi).Radius(3000).FillColor(Colors.ARGB(50,50,220,125)).StrokeColor(Colors.Black)
    gmapExtra.AddCircle(gmap, co)
    
'And now Remove Circle'   
    gmapExtra.Remove
 

TILogistic

Expert
Licensed User
Longtime User

Dim c As Circle
c = gmapExtra.AddCircle(gmap, co)
c.Remove

see:
 

TILogistic

Expert
Licensed User
Longtime User
see:

B4X:
    Dim CircleOptions1 As CircleOptions
    Dim Circle1 As Circle 'Optional global variable
    CircleOptions1.Initialize
    CircleOptions1.Center2(MapLatitude, MapLongitude).Radius(300).FillColor(Colors.ARGB(150, 255, 229, 179)).StrokeColor(Colors.ARGB(150, 240, 58, 23)).StrokeWidth(2.0)
    Circle1 = GoogleMapsExtras1.AddCircle(GoogleMap1, CircleOptions1)
'    remove
    Circle1.Remove

sample:
 

Attachments

  • 1.gif
    388.9 KB · Views: 373

NGUYEN TUAN ANH

Active Member
Licensed User
Please Help me, I run your Example Demo but AndroidMapsUtils and KMLLayer error on my B4A10.7 and targetSdkVersion="30"
main$ResumableSub_Activity_Createresume (java line: 432)
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/LruCache;
at com.google.maps.android.data.Renderer.<init>(Renderer.java:115)
at com.google.maps.android.data.kml.KmlRenderer.<init>(KmlRenderer.java:46)
at com.google.maps.android.data.kml.KmlLayer.<init>(KmlLayer.java:44)
at uk.co.martinpearman.b4a.androidmapsutils.data.kml.KMLLayer.Initialize(KMLLayer.java:30)
at nta.kml.ge.main$ResumableSub_Activity_Create.resume(main.java:432)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:238)
at android.app.ActivityThread.main(ActivityThread.java:7798)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by: java.lang.ClassNotFoundException: android.support.v4.util.LruCache
... 15 more
main$ResumableSub_Activity_Createresume (java line: 432)
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/LruCache;
at com.google.maps.android.data.Renderer.<init>(Renderer.java:115)
at com.google.maps.android.data.kml.KmlRenderer.<init>(KmlRenderer.java:46)
 

NGUYEN TUAN ANH

Active Member
Licensed User
This error means that the library needs to be jetified (Tools - Jetify libraries).
I tried running Tools - Jetifier (AndroidX) - Jetify libraries but it didn't fix the "Failed resolution of: Landroid/support/v4/util/LruCache; " error
Coud you please help me !
 

NGUYEN TUAN ANH

Active Member
Licensed User
[QUOTE = "Erel, bài đăng: 831483, thành viên: 1"]
Bạn có thấy thư viện KML trong danh sách các thư viện sẽ bị hủy bỏ không? Lưu ý rằng các thư viện nội bộ sẽ không bị kiểm duyệt.
[/TRÍCH DẪN]
Thank Erel, Let me see
 

NGUYEN TUAN ANH

Active Member
Licensed User
Did you see the KML library in the list of libraries that will be jetified? Note that internal libraries will not be jetified.
Yes, i see


I tried running Tools - Jetifier (AndroidX) - Jetify libraries but it didn't fix the "Failed resolution of: Landroid/support/v4/util/LruCache; " error
Coud you please help me !
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…