Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

StaticMapGenerator

A library that makes dealing with the Math of the Mercator Projection and the Google's Static Maps Library painless.

Some nifty uses:

Detailed documentation can be found here.

Simply converting points between Global and Mercator space:

Location home = new Location(102, 50);
Location mercator = Mercator.globeToMercator(home);

Finding the midpoint between two places as it would appear on a mercator map:

Location center = Mercator.mercatorMidpoint(new Location(0, 0), new Location(85, 0));
// center != (42.5, 0);

Getting a map from Google Static Maps Library with the maximum level of zoom which includes 2 given points:

Location home = new Location(0, 0);
Location work = new Location(80, 0); // Killer commute
ute

StaticMap map = new StaticMap(home, work, KEY);
showBufferedImage(map.getMapImage()); // hypothetical function

Finding where a point would occur on a given StaticMap:

Location home = new Location(0, 0);
Location work = new Location(80, 0); // Killer commute

StaticMap map = new StaticMap(home, work, KEY);
showBufferedImage(map.getMapImage()); // hypothetical function

Location testPoint = map.getLocationInImage(new Location(40, 0)); // Won't be in the center of the image!
plot(map.getMapImage(), testPoint); // hypothetical function

Adding it to your project

If you're not using maven here is the .jar.

Project is pending addition to maven central. In the meantime you can use the following bintray maven repository:

Add the following to your <repositories>

<repository>
	<id>bintray-parth-mehrotra-staticmaps</id>
	<name>bintray</name>
	<url>http://dl.bintray.com/parth-mehrotra/staticmaps</url>
</repository>

and the following to your <dependencies>

<dependency>
	<groupId>com.parth.geo</groupId>
	<artifactId>StaticMaps</artifactId>
	<version>1.0</version>
</dependency>

Releases

No releases published

Packages

No packages published

Languages