Get support for WyriHaximus/StaticMap
If you're new to LTH, please see our FAQ for more information on what it is we do.
Support Options
Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:
View Open IssuesTake a look to see if anyone else has experienced the same issue as you and if they managed to solve it.
Open an IssueMake sure to read any relevant guidelines for opening issues on this repo before posting a new issue.
Sponsor directlyCheck out the page and see if there are any options to sponsor this project or it's developers directly.
WyriHaximus/StaticMap
StaticMap
Static Google Maps clone in PHP
Getting started
1. Requirements
This plugin depends on the following plugins and libraries and are pulled in by composer later on:
-
ext-gd
2. Installation
To install via Composer, use the command below, it will automatically detect the latest version and bind it with ~
.
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:
<?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:
<?php
$renderer->addCenterBlip();
Our Mission
We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.
From the Blog
Interesting Articles
-
Generating income from open source
Jun 23 • 8 min read
-
2023 State of OSS
Apr 23 • 45 min read ★
-
A funding experiment...
Aug 19 • 10 min read
-
But You Said I could
Aug 19 • 2 min read
Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated
p-e622a1a2