An open library of RPG Maker MV plugins, powered by the community.

PGMV - The Community-Driven Plugin Library for RPG Maker MV

MV plugins

TM Google Maps - TMGoogleMaps.js

Plugin desc : Accesses Google Maps to obtain and display map images.

License : MIT License

Author : tomoaky

Desc page : https://github.com/munokura/tomoaky-MV-plugins

Download Page : https://raw.githubusercontent.com/munokura/tomoaky-MV-plugins/refs/heads/master/TMGoogleMaps.js

File name : TMGoogleMaps.js

Help of plugin :

@plugindesc Accesses Google Maps to obtain and display map images.
@author tomoaky
@url https://github.com/munokura/tomoaky-MV-plugins
@license MIT

@help
English Help Translator: munokura
This is an unofficial English translation of the plugin help,
created to support global RPG Maker users.
Feedback is welcome to improve translation quality
(see: https://github.com/munokura/tomoaky-MV-plugins ).
Original plugin by tomoaky.
-----

Note:
When creating a game using this plugin, please be sure to also read the Google Maps Terms of Use. The plugin author assumes no responsibility for any disadvantages arising from use; use is at your own risk.

How to Use:
First, run the plugin command geoCoding to obtain real-world coordinates.
Once successfully obtained, run geoParallax to change the distant view to a map with those coordinates.

Plugin Command:
geoCoding address Japan
Geocoding by address or place name. In this example, we connect to Google Maps to obtain information for locations corresponding to the place name Japan. To check whether communication is complete, use the script command described below.

geoCoding actor 5
Geocoding by the name of actor 5.

geoCoding vn 10
Geocoding using the value of variable 10

geoCoding latlng 35.794 139.790
Reverse geocoding using latitude and longitude

googleParallax 1 2
Sets the map image obtained from the previous geocoding result as the background view.
The values are the scroll distance (X and Y) of the background view.

googlePicture 1 0 48 96 100 100 255 0
Displays the map image obtained from the previous geocoding result as a picture.
The values are, from left to right, picture number, origin (0 = top left / 1 = center), X coordinate, Y coordinate,
magnification (horizontal), magnification (vertical), opacity, and blending method.
The values at the end can be omitted, but for example, the magnification alone cannot be omitted. If you enter four values, only the picture number through the Y coordinate will be valid.

googleMapType 2
Sets the map image type. This command does not apply to images downloaded prior to this command. Use a value between 0 and 3.
0 = roadmap / 1 = satellite / 2 = hybrid / 3 = terrain

googleMapZoom 12
Sets the zoom factor for the map image. This command does not apply to images downloaded prior to this command. This is the map scale, not the image size.

googleMapWidth 512
Sets the resolution (width) of the map image. This command does not apply to images downloaded prior to this command.

googleMapHeight 512
Sets the resolution (height) of the map image. This command does not apply to images downloaded prior to this command.

googleAddress 4
Assigns the address obtained by the most recent geocoding run to the specified game variable. In this example, the address (string) is assigned to game variable number 4.

Script Command:
After executing geocoding, you need to check whether communication is complete.
Since there is no command for this check, we will use the "script" Event's Contents.

$gameTemp.isGeoCodingComplete()
Returns true if geocoding communication is complete.

$gameTemp.isGeoCodingError()
Returns true if an error occurs during geocoding communication.

$gameSystem.isGeoDataEmpty()
Returns true if coordinates could not be obtained as a result of geocoding communication.

Use the above three scripts in the "loop" and "conditional branch" Event's Contents to monitor the communication status and results. Finally, execute geoParallax when isGeoCodingComplete is true and isGeoDataEmpty is false.

Bonus Traits:
You can also obtain the distance from the previous geocoding.
$gameSystem.getGeoDataDistance()
By using the above command as a script for the "Variable Operation" Event's Contents,
you can assign the difference (distance) from the coordinates obtained by the previous geocoding run to a variable.
If the previous or previous geocoding failed, -1 will be assigned.

If you want to display distance in the "Show Text" Event's Contents, use the control character ¥DIST, which will display the distance with three decimal places and units.
There is no need to use getGeoDataDistance.

@param earthR
@desc Earth radius (km) Default: 6378.137
@default 6378.137

スポンサードリンク

-MV plugins

Copyright© PGMV - The Community-Driven Plugin Library for RPG Maker MV , 2026 All Rights Reserved.