yandex-maps-static-api

Library for working with Yandex Maps Static API 1.x

License

License

Categories

Categories

Dex General Purpose Libraries Utility
GroupId

GroupId

io.github.mvpotter
ArtifactId

ArtifactId

yandex-maps-static-api
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

yandex-maps-static-api
Library for working with Yandex Maps Static API 1.x
Project URL

Project URL

http://mvpotter.github.io/yandex-maps-static-api
Source Code Management

Source Code Management

https://github.com/mvpotter/yandex-maps-static-api.git

Download yandex-maps-static-api

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.mvpotter/yandex-maps-static-api/ -->
<dependency>
    <groupId>io.github.mvpotter</groupId>
    <artifactId>yandex-maps-static-api</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.mvpotter/yandex-maps-static-api/
implementation 'io.github.mvpotter:yandex-maps-static-api:1.0'
// https://jarcasting.com/artifacts/io.github.mvpotter/yandex-maps-static-api/
implementation ("io.github.mvpotter:yandex-maps-static-api:1.0")
'io.github.mvpotter:yandex-maps-static-api:jar:1.0'
<dependency org="io.github.mvpotter" name="yandex-maps-static-api" rev="1.0">
  <artifact name="yandex-maps-static-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.mvpotter', module='yandex-maps-static-api', version='1.0')
)
libraryDependencies += "io.github.mvpotter" % "yandex-maps-static-api" % "1.0"
[io.github.mvpotter/yandex-maps-static-api "1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : jcl-over-slf4j jar 1.6.4
org.slf4j : log4j-over-slf4j jar 1.6.4
org.slf4j : slf4j-api jar 1.6.4

runtime (1)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 0.9.28

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Build Status

yandex-maps-static-api

Java library for working with Yandex Maps Static API 1.x

Supports

Maven Coordinates

<dependency>
    <groupId>io.github.mvpotter</groupId>
    <artifactId>yandex-maps-static-api</artifactId>
    <version>1.0</version>
</dependency>

Usage

// Firstly, you need to create YandexMap object
YandexMap yandexMap = new YandexMap();

// Init required fields
yandexMap.setMapType(YandexMap.MapType.HYBRID);
yandexMap.setCenter(new Coordinate("37.660286", "55.743301"));
yandexMap.setViewport(new Coordinate("0.005", "0.005"));
yandexMap.setScale(7);
yandexMap.setSize(new Size(650, 450));
yandexMap.setLanguage(YandexMap.Language.RUSSIAN);

// Add curve (you can add multiple curves if necessary)
Curve curve = new Curve();
curve.setColor(Color.BLACK);
curve.addPoint(new Coordinate("37.656577", "55.741176"));
curve.addPoint(new Coordinate("37.656748", "55.741419"));
curve.addPoint(new Coordinate("37.655131", "55.741814"));
curve.addPoint(new Coordinate("37.658257", "55.742524"));
yandexMap.addPolyline(curve);

// Add polygon (multiple if necessary)
Polygon polygon = new Polygon();
polygon.setColor(Color.WHITE);

// Add outer line (the enclosed area will be filled with color)
Curve outerCurve = new Curve();
outerCurve.addPoint(new Coordinate("0", "0"));
outerCurve.addPoint(new Coordinate("0", "4"));
outerCurve.addPoint(new Coordinate("4", "4"));
outerCurve.addPoint(new Coordinate("4", "0"));
polygon.addCurve(outerCurve);

// Add inner line (the enclosed area will not be filled)
Curve innerCurve = new Curve();
innerCurve.addPoint(new Coordinate("1", "1"));
innerCurve.addPoint(new Coordinate("1", "3"));
innerCurve.addPoint(new Coordinate("3", "3"));
innerCurve.addPoint(new Coordinate("3", "1"));
polygon.addCurve(innerCurve);

yandexMap.addPolyline(polygon);

// Add markers
yandexMap.addMarker(new Marker(new Coordinate("37.656577", "55.741176")));
yandexMap.addMarker(new Marker(new Coordinate("37.656748", "55.741419"), Style.FLAG));
yandexMap.addMarker(new Marker(new Coordinate("37.655131", "55.741814"), Style.PIN, Type.BLACK));
yandexMap.addMarker(new Marker(new Coordinate("37.658257", "55.742524"), Style.PIN, Type.GRAY));
yandexMap.addMarker(new Marker(new Coordinate("37.660286", "55.743301"), Style.SQUARE, Type.A));
yandexMap.addMarker(new Marker(new Coordinate("37.661831", "55.745165"), Style.SQUARE, Type.B));
yandexMap.addMarker(new Marker(new Coordinate("37.662947", "55.743108"), Style.ROUND, Type.B));

// Use YandexApiUrlBuilder to generate appropriate URL for using in a browser or web component
YandexApiUrlBuilder yandexApiUrlBuilder = new YandexApiUrlBuilder();
String url = yandexApiUrlBuilder.build(yandexMap);

Versions

Version
1.0