Google Maps Library question about Marker2 method

BvdB

Member
Licensed User
G'day folks.

I am struggling with this method. I want to use it to declare a custom image as the map marker.

B4X:
myPositionMarker =  GoogleMapInstance.AddMarker(gpsLatCoordinate, gpsLongCoordinate, "You're Here") 'default marker

myPositionMarker = GoogleMapInstance.AddMarker3 (gpsLatCoordinate, gpsLongCoordinate, "You're Here", "vehicle1.png") 'my custom marker
I want to use vehicle1.png (stored in the app's Files\ directory) as the custom marker.

The compiler gives me a warning "Types does not match. (warning #22)" and when I run it the following error appears:

myPositionMarker = GoogleMapInstance.AddMarker3 (gpsLatCoordinate, gpsLongCoordinate, \
javac 1.7.0_21
src\Gr8Guides\MobileSafariGuide\viewmap.java:616: error: inconvertible types
_mypositionmarker = _googlemapinstance.AddMarker3(_gpslatcoordinate,_g pslongcoordinate,"You're Here",(android.graphics.Bitmap)("vehicle1.png"));

I am doing something wrong about the file location of the file, and I can't figure it out.

This is probably something very elementary for you B4A experts, but I just don't seem to find the correct info in the vast info pool.

Forgive me if you think I waste your time, but I am sure it will take you less then 60 seconds to assist me with this one.

Thanks in advance, clever chaps.
 

rboeck

Well-Known Member
Licensed User
Yesterday i posted an working example; search the forum for addmarker3. You have to declare a bitmap, load it. It is not possible, to take only the filename - you have to use the bitmap object.
Greetings
Reinhard
 
Top