Google static maps builder

Helper library for building google static maps image url

License

License

GroupId

GroupId

com.github.marlonlom
ArtifactId

ArtifactId

staticmaps-builder
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

Google static maps builder
Helper library for building google static maps image url
Project URL

Project URL

https://github.com/marlonlom/staticmaps_builder
Source Code Management

Source Code Management

https://github.com/marlonlom/staticmaps_builder

Download staticmaps-builder

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.marlonlom/staticmaps-builder/ -->
<dependency>
    <groupId>com.github.marlonlom</groupId>
    <artifactId>staticmaps-builder</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.marlonlom/staticmaps-builder/
implementation 'com.github.marlonlom:staticmaps-builder:1.0.0'
// https://jarcasting.com/artifacts/com.github.marlonlom/staticmaps-builder/
implementation ("com.github.marlonlom:staticmaps-builder:1.0.0")
'com.github.marlonlom:staticmaps-builder:aar:1.0.0'
<dependency org="com.github.marlonlom" name="staticmaps-builder" rev="1.0.0">
  <artifact name="staticmaps-builder" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.marlonlom', module='staticmaps-builder', version='1.0.0')
)
libraryDependencies += "com.github.marlonlom" % "staticmaps-builder" % "1.0.0"
[com.github.marlonlom/staticmaps-builder "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 24.0.0

Project Modules

There are no modules declared in this project.

Google Static Map Url Builder

Utility for creating Google static maps url with a few simple options.

##Synopsis Sometimes, we need to present a grid screen with some google maps as thumbnails, but, for android apps, you need to include google play services, and use google maps api for loading MapFragment instances, specifically using lite mode.

For a simpler approach, you can use the Google Static Maps API for construct such image map urls using some parameters.

With this library, you can apply for the second note, yeah, you can build static maps image urls, using options like latitude, longitude, zoom, image width and height, and adding markers to the map.

It uses the Fluent Builder pattern, making this process as simple as possible.

##Usage Add dependency.

(Gradle)
dependencies {
  compile 'com.github.marlonlom:staticmaps-builder:1.0.0'
}

(Maven)
<dependency>
    <groupId>com.github.marlonlom</groupId>
    <artifactId>staticmaps-builder</artifactId>
    <version>1.0.0</version>
</dependency>

This repository contains the sample module, you can check it out.

For creating static maps, use the StaticMapUrl class

StaticMapUrl.create()
  .centered(_latitude_, _longitude_)
  .size(_imageWidth_, _imageHeight_)
  .zoom(_zoom_)
  .mark(_marker_)
  .build();

The result is a string containing the url:

Sample generated static map

For creating markers and add it to the static maps, use the StaticMapMarker class

StaticMapMarker.create(_color_, _latitude_, _longitude_).medium())

The color for the marker can be set as a 24-bit color (example: color=0xFFFFCC) or a predefined color using the folowwing set (black, brown, green, purple, yellow, blue, gray, orange, red, white).

The size of the marker is important, there are three methods, that must be used after create() method: small(), medium(), tiny()

###Demo

Check the Demo here.

##Spread the word

If you like this library, please tell others about it ๐Ÿ‘ ๐Ÿ‘

###License

Copyright 2016 marlonlom

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.0.0