Godot plugin to display and manipulate a google map view
To use this plugin you will need to compile it against your required version of Godot.
You will need:
- Android Studio https://developer.android.com/studio
- Godot AAR Library for your desired version https://godotengine.org/download/
- Open the project in Android Studio
- Put your downloaded Godot AAR Library into the
app/libs
directory. (Ensure its filename matchesgodot-lib*.aar
)
- Compile the project
- Copy the
app/build/outputs/aar/MapPlugin.aar
file and theapp/MapPlugin.gdap
file to theandroid/plugins
folder into your Godot app directory.
- Go to Project -> Export, select the android export, check custom build, and enable the plugin.
extends Node2D
func _ready():
# Load The plugin
var mapPlugin = Engine.get_singleton("MapPlugin")
# Connect to the response signal
mapPlugin.connect("onLocationUpdateResponse", self, "on_LocationUpdateResponse")
# Create the map
mapPlugin.createMap()
# Set the current Location
mapPlugin.setLocation(12.3456789, 12.3456789)
func on_LocationUpdateResponse(locationData: Dictionary):
# Print the location details: { "latitude": 12.3456789, "longitude": 12.3456789 }
print(locationData)