B4A Library GoogleMapsExtras

GoogleMapsExtras is an ongoing project to implement more of the Google Maps Android v2 classes in Basic4Android.

Currently the library allows you to create these objects:

Tutorials for each object will be uploaded to the Google Maps Android v2 tutorial thread.

Martin.
 

Attachments

  • GoogleMapsExtras_v1_71.zip
    59.6 KB · Views: 2,693
  • MapsForgeTileProvider_v1.01.zip
    173.1 KB · Views: 2,567
  • GoogleMapsExtras_v2_0_library_files.zip
    82.5 KB · Views: 2,991
Last edited:

warwound

Expert
Licensed User
Longtime User
Well i'm pretty sure if not a GoogleMaps related problem so you'd best start a new thread or post in the AHQuickAction thread.

Martin.
 

marcick

Well-Known Member
Licensed User
Longtime User
I did another test with a backup copy of my project and restored GoogleMapextras 1.61.

I open it with B4A 3.2 and it compiles correctly.
I update to GoogleMapextras 1.7 and it compiles correctly.
I edit the manifest as described and add the #AdditionalRes line and I get the compile error.

It seems a conflict with AHquickaction library ...
 

warwound

Expert
Licensed User
Longtime User
Do both AHQuickAction and GoogleMaps require an #AdditionalRes entry and you're only including one entry for GoogleMaps?
I did read a thread that explained how to add more than one value to the #AdditionalRes attribute - can find that thread now.

Martin.
 

marcick

Well-Known Member
Licensed User
Longtime User
AHQuickAction does not require #AdditionalRes entry, I'm using it since a long time

I see now that the compile error appears adding the

B4X:
#AdditionalRes: C:\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms

And disappear removing it
 

warwound

Expert
Licensed User
Longtime User
GoogleMapsExtras updated to version 1.71

This update adds support for the TileOverlay and TileOverlayOptions FadeIn feature.

TileOverlay
Properties:

  • FadeIn As Boolean
    Get or Set whether the tiles should fade in.
    Default value is True.

TileOverlayOptions
Methods:

  • GetFadeIn As Boolean
  • SetFadeIn (FadeIn As Boolean) As TileOverlayOptions
    Set whether the tiles should fade in.
    Default value is True.

The FadeIn feature is part of the January 2014 update to the Google Play Services library:
https://developers.google.com/maps/documentation/android/releases#january_2014

Be sure to update your SDK if you wish to use the new FadeIn feature.

Version 1.71 is attached to the first post in this thread.

Martin.
 

scrat

Active Member
Licensed User
Longtime User
Hello,
I'm trying to use xml themes with mapsforge.
I just encounter a problem with resource files.
What is the default path?

Xml file contains this type of declaration

B4X:
<rule e="way" k="building" v="church|cathedral|chapel" zoom-min="14">
       <symbol src="file:/symbols/church.png" />
</rule>

Thanks
 

scrat

Active Member
Licensed User
Longtime User
It works if I change

B4X:
file:

by

B4X:
jar:/assets

is it possible to define a custom directory same as xml file ?
 

warwound

Expert
Licensed User
Longtime User
To be honest i don't really know!

This isn't something i've really tried to do myself yet.
I'm sure it's possible to set the resource path to anything you want but exactly what syntax is required is probably a case of trial and error til you find what works.
Absolute and relative paths are possible - again i don't know enough to answer your question.

This page is worth a read, though it doesn't seem to address resource paths: http://code.google.com/p/mapsforge/wiki/RenderThemeAPI
An answer may be on this page: https://groups.google.com/forum/?fromgroups&hl=en#!topic/mapsforge-dev/wUMudj8-zHM
Where post #2 states that modifying the render theme xml requires changing jar: to file: as you seem to have already found.

Martin.
 

scrat

Active Member
Licensed User
Longtime User
Thanks Martin.
I continue my research

Just a workaround for this bug
The MapsForge library which i have created the MapsForgeTileProvider from has had a bug when rendering tiles which contain both land and sea for a long while.

in osmarender.xml you can add
B4X:
  <!-- sea patch-->
    <rule e="way" k="natural" v="*">
        <rule e="way" k="natural" v="sea">
            <area fill="#b5d6f1" />
        </rule>
        <rule e="way" k="natural" v="nosea">
            <area fill="#f8f8f8" stroke="#f8f8f8" stroke-width="1.5" />
        </rule>
    </rule>

and tiles with sea/land is rendered correctly
 

warwound

Expert
Licensed User
Longtime User
Thanks Martin.
I continue my research

Just a workaround for this bug


in osmarender.xml you can add
B4X:
  <!-- sea patch-->
    <rule e="way" k="natural" v="*">
        <rule e="way" k="natural" v="sea">
            <area fill="#b5d6f1" />
        </rule>
        <rule e="way" k="natural" v="nosea">
            <area fill="#f8f8f8" stroke="#f8f8f8" stroke-width="1.5" />
        </rule>
    </rule>

and tiles with sea/land is rendered correctly

That's very interesting - i'll try it later.
If it works i can incorporate it into the default render theme xml file included with the library.

Martin.
 

scrat

Active Member
Licensed User
Longtime User
after changing the xml file in your library I have this result
 

Attachments

  • Screenshot_2014-02-09-10-29-28.png
    Screenshot_2014-02-09-10-29-28.png
    238.1 KB · Views: 290
  • osmarender.zip
    5.4 KB · Views: 221

warwound

Expert
Licensed User
Longtime User
:(

The XML patch didn't work here.
Rivers rendered correctly just as they did before the patch.
But any tiles containing sea still render sea with the tile's default background color.

Screenshot attached.

Martin.
 

Attachments

  • mapsforge-sea-tiles.jpg
    mapsforge-sea-tiles.jpg
    96.1 KB · Views: 266

scrat

Active Member
Licensed User
Longtime User
I think you use the map file from mapsforge.
I use the map file from http://www.openandromaps.org/en/downloads/europe because it has a full coverage for France
This file surely have a change to use the patch.
you can try the file for your country, I think it works.

Edit The Great Britain file works
 

Attachments

  • Screenshot_2014-02-09-15-35-32.png
    Screenshot_2014-02-09-15-35-32.png
    357.4 KB · Views: 205
Last edited:

warwound

Expert
Licensed User
Longtime User
MapsForgeTileProvider updated to version 1.01

This update contains a very slightly modified render theme xml file.
Have a read of this post: http://www.b4x.com/android/forum/threads/googlemapsextras.26277/page-6#post-221952.

Forum member scrat reported that this render theme modification when used in conjunction with map database files downloaded from openandromaps results in perfectly rendered tiles which contain both land and sea.

The old and ongoing problems with tiles that contain both land and sea is fixed with this update and a map database from openandromaps.

Version 1.01 of MapsForgeTileProvider is attached to the first post in this thread.

Martin.
 

rboeck

Well-Known Member
Licensed User
Longtime User
Hi Martin,

i think the use of heat maps offers new possibilities for the use of google maps. I imagine maps with infection data of fungal diseases in wineyards etc. Farmes may send an warning sms to center station with their gps position; the center could automaticly generate a maps with the current status.
 

warwound

Expert
Licensed User
Longtime User
GoogleMapsExtras updated to version 1.80

This update adds support for the StreetView features found in the May 2014 Google Play Services update.
More info about the May 2014 update can be found here: https://developers.google.com/maps/documentation/android/releases#may_2014.

Google Street View provides panoramic 360-degree views from designated roads throughout its coverage area.
The coverage available through the Google Maps Android API v2 is the same as that for the Google Maps app on your Android device.
The list of currently supported cities for Street View is available at the Google Maps Help Center.

The StreetViewPanorama class models the Street View panorama in your application.
Within your UI, a panorama is represented by a StreetViewPanoramaFragment or StreetViewPanoramaView object.

I've not implemented the StreetViewPanoramaFragment object, instead i've just implemented the StreetViewPanoramaView object.

The StreetViewPanoramaView object can not only display 'official Google StreetView', it can also display 'user contributed photospheres' hosted on Google Views.
More info about photospheres can be found here: https://www.google.co.uk/maps/about/contribute/photosphere/.
(The StreetViewPanoramaView can only display remote content - it cannot display local device based content).

Once you have submitted a photosphere to Google Views, it is assigned a unique string panoid, you need the panoid in order to display the photosphere using a StreetViewPanoramaView.
A submitted photosphere will also automatically be moderated for inclusion in the official Google Maps website, if accepted for inclusion then the photosphere is discoverable and viewable to any user of the Google Maps website.
(When the Google Maps user enables StreetView using the 'pegman', photospheres appear as blue dots which the user can hover over or click on).

You can display a photosphere using a StreetViewPanoramaView regardless of whether or not the photosphere was accepted for inclusion in Google Maps.

The StreetViewPanoramaView allows full programmatic control - bearing, zoom level and tilt are all settable.
You can enable/disable touch and zoom gestures, user navigation and the display of street names too.

The StreetViewPanoramaView can be used in a b4a project alongside a GoogleMap or it can be used standalone in a project with no GoogleMap.
Note though that even if you do not use a Google Map you will still require an API key and need to make the manifest modifications required just as you must do if you do use a Google Map.
More onfo on the API key and manifest modifications can be found here: http://www.b4x.com/android/forum/threads/google-maps-android-v2-tutorial.24415/.

I've created a couple of b4a example projects and shall upload them to the Google Maps tutorial thread.

Version 1.80 is attached to the first post in this thread.

Martin.

[edit]The two example projects can be found here: http://www.b4x.com/android/forum/threads/google-maps-android-v2-tutorial.24415/page-23#post-250550[/edit]
 
Last edited:
Top