2017 © Pedro Peláez
 

library staticmap

PHP implementation of the Google Maps Static API

image

wyrihaximus/staticmap

PHP implementation of the Google Maps Static API

  • Saturday, September 16, 2017
  • by WyriHaximus
  • Repository
  • 4 Watchers
  • 3 Stars
  • 193 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 6 Open issues
  • 6 Versions
  • 12 % Grown

The README.md

StaticMap

Build Status Latest Stable Version Total Downloads Coverage Status Bitdeli Badge, (*1)

Static Google Maps clone in PHP, (*2)

Getting started

1. Requirements

This plugin depends on the following plugins and libraries and are pulled in by composer later on:, (*3)

  • ext-gd

2. Installation

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ~., (*4)

composer require wyrihaximus/staticmap 

3. Example

<?php

use Imagine\Gd\Imagine;
use Imagine\Image\Box;
use WyriHaximus\StaticMap;

require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

$width = 256;
$height = 256;
$zoom = 7;
$latitude = 0;
$longitude = 0;

$renderer = new StaticMap\Renderer(
    new Imagine(),
    $zoom,
    new Box($width, $height),
    new StaticMap\LatLng($latitude, $longitude),
    new StaticMap\Tiles('http://example.com/tiles/' . $zoom . '/{x}/{y}.png')
);

header('Content-Type: image/png');
echo $renderer->generate()->get('png', array(
    'quality' => 9,
));

4. Blips

Blips are markers on the map. Added them is simple:, (*5)

<?php
use WyriHaximus\StaticMap\Blip;
use WyriHaximus\StaticMap\LatLng;

$renderer->addBlip(Blip::create(new LatLng(123, 456), 'http://static.wyrimaps.net/icons/blip.png'));

In case you just want one in the center this will suffice:, (*6)

<?php

$renderer->addCenterBlip();

The Versions

16/09 2017

dev-master

9999999-dev http://wyrihaximus.net/projects/php/staticmap.html

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

The Development Requires

maps graphics image processing static maps

10/08 2013

0.2.2

0.2.2.0 http://wyrihaximus.net/projects/php/staticmap.html

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

The Development Requires

maps graphics image processing static maps

10/08 2013

0.2.1

0.2.1.0 http://wyrihaximus.net/projects/php/staticmap.html

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

The Development Requires

maps graphics image processing static maps

03/02 2013

0.2.0

0.2.0.0 http://wyrihaximus.net/projects/php/staticmap

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

maps graphics image processing static maps

23/01 2013

0.1.1

0.1.1.0 http://wyrihaximus.net/projects/php/staticmap

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

image manipulation graphics image processing drawing

21/01 2013

0.1.0

0.1.0.0 http://wyrihaximus.net/projects/php/staticmap

PHP implementation of the Google Maps Static API

  Sources   Download

MIT

The Requires

 

image manipulation graphics image processing drawing