Download the PHP package arraypress/google-maps-static without Composer
On this page you can find all versions of the php package arraypress/google-maps-static. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download arraypress/google-maps-static
More information about arraypress/google-maps-static
Files in arraypress/google-maps-static
Download arraypress/google-maps-static
More information about arraypress/google-maps-static
Files in arraypress/google-maps-static
Vendor arraypress
Package google-maps-static
Short Description A PHP library for integrating with the Google Maps Static API in WordPress, providing static map image generation with support for markers, paths, styling, and custom overlays. Features WordPress error handling and customizable image generation.
License GPL-2.0-or-later
Homepage https://github.com/arraypress/google-maps-static/
Package google-maps-static
Short Description A PHP library for integrating with the Google Maps Static API in WordPress, providing static map image generation with support for markers, paths, styling, and custom overlays. Features WordPress error handling and customizable image generation.
License GPL-2.0-or-later
Homepage https://github.com/arraypress/google-maps-static/
Please rate this library. Is it a good library?
Informations about the package google-maps-static
Google Maps Static API for WordPress
A PHP library for integrating with the Google Maps Static API in WordPress, providing easy-to-use methods for generating
static map images with various features including markers, paths, styled maps, and custom locations. Features WordPress
integration and WP_Error
support.
Features
- πΊοΈ Multiple Map Types: Support for roadmap, satellite, terrain, and hybrid views
- π Marker Integration: Add custom markers with various styles and positions
- π£οΈ Path Drawing: Create routes and shapes with customizable paths
- π¨ Custom Styling: Comprehensive map styling options
- β‘ WordPress Integration: Native WP_Error support and URL escaping
- π‘οΈ Type Safety: Full type hinting and strict types
- π Flexible Sizing: Custom dimensions and scale options
- π Global Support: Works with locations worldwide, with language and region settings
- π― Multiple Formats: Support for PNG, JPG, and GIF outputs
- π± Responsive: Support for different scale factors
- β¨ Easy Implementation: Simple, chainable API methods
- πΎ Media Library Integration: Save maps directly to WordPress media library
- π₯ Street View Support: Configure heading and pitch for street view perspectives
- π Method Chaining: Fluent interface for setting options
- βοΈ Validation: Built-in parameter validation for all setters
Requirements
- PHP 7.4 or later
- WordPress 5.0 or later
- Google Maps Static API key
Installation
Install via Composer:
Basic Usage
Configuration Methods
Setting Options
Getting Options
Extended Examples
Saving Maps to Media Library
Working with Markers
Creating Paths
Styled Maps
Street View Configuration
API Methods
Main Methods
location( $location, $options = [] )
: Generate URL for a specific locationmarkers( $markers, $options = [] )
: Generate URL with custom markerspath( $path_points, $options = [] )
: Generate URL with a pathstyled( $styles, $options = [] )
: Generate URL with custom stylingsave_to_media_library( $url, $args = [] )
: Save static map to WordPress media librarygenerate_image_tag( $url, $attrs = [] )
: Generate complete img HTML tagvalidate_api_key()
: Verify if the API key is valid
Setter Methods
set_size( $width, $height)
: Set map dimensionsset_zoom( $level)
: Set zoom level (0-21)set_map_type( $type)
: Set map typeset_format( $format)
: Set image formatset_scale( $scale)
: Set map scaleset_language( $language)
: Set map labels languageset_region( $region)
: Set map region biasset_heading( $degrees)
: Set street view heading (0-360)set_pitch( $degrees)
: Set street view pitch (-90 to 90)set_api_key( $api_key)
: Set new API key
Getter Methods
get_size()
: Get current dimensionsget_zoom()
: Get current zoom levelget_map_type()
: Get current map typeget_format()
: Get current image formatget_scale()
: Get current scale valueget_language()
: Get current languageget_region()
: Get current regionget_heading()
: Get current headingget_pitch()
: Get current pitchget_api_key()
: Get current API keyget_options()
: Get all current options
Options Parameters
Common Options
size
: Map dimensions (required)zoom
: Zoom level (0-21)maptype
: Map type (roadmap, satellite, terrain, hybrid)format
: Image format (png, jpg, gif)scale
: Image scale (1, 2, 4)language
: Map labels language (e.g., 'en', 'es', 'fr')region
: Region bias (e.g., 'US', 'GB')heading
: Street view heading in degrees (0-360)pitch
: Street view pitch in degrees (-90 to 90)
Marker Options
color
: Marker colorsize
: Marker size (tiny, mid, small)label
: Single character labelicon
: Custom icon URLscale
: Marker scale
Path Options
weight
: Line weightcolor
: Line colorgeodesic
: Follow earth's curvaturefillcolor
: Fill color for closed paths
Use Cases
- Business Listings: Display store locations
- Real Estate: Show property locations
- Event Maps: Display venue locations
- Travel Routes: Visualize travel paths
- Location Markers: Highlight multiple points
- Custom Territory: Display service areas
- Geographic Data: Visualize data points
- Styled Maps: Brand-specific map designs
- Direction Overview: Show route overview
- Location Context: Add visual location context
- Street Level Views: Show building facades and street perspectives
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the GPL-2.0-or-later License.
Support
All versions of google-maps-static with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
The package arraypress/google-maps-static contains the following files
Loading the files please wait ....