maplib

this project provides a map library

Лицензия

Лицензия

Группа

Группа

com.github.martinfrank
Идентификатор

Идентификатор

maplib
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

maplib
this project provides a map library
Ссылка на сайт

Ссылка на сайт

https://github.com/martinFrank/map-library
Организация-разработчик

Организация-разработчик

Martin Frank
Система контроля версий

Система контроля версий

https://github.com/martinFrank/map-library/tree/master

Скачать maplib

Как подключить последнюю версию

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.github.martinfrank : drawlib jar 0.4.1
com.github.martinfrank : geolib jar 0.1.0

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

map-library

a map is a geographical 2D representation of fields that are connected to each other. The concept of a map originates mainly from 2D-games. Hence the map is rastered.

the major reason for using this library is that it is platform independ and uses only java basic functionality (only java.lang and java.util)

Map Types

there are 3 different types of maps implemented:

  • hexagonal (vertical or horizontal)
  • squared map (squares, diamonds, isometric)
  • triangle map (vertical or horizontal)

Data Types

the map is build up from fields: F, edges E and nodes N, they all together form the map.

A Map has:
  • all fields:
    List<F> fields = getFields();
    
  • an aggregation - a set of shape that form the map.
    the aggreagtion is the graphical representation of the map
    Aggregation aggregation = getAggregation();
    double widthOfMap = aggregation.getWidth(); //real size after scale
    double heightOfMap = aggregation.getHeight(); //real size after scale
    
A field has:
  • neighbors (other map fields)
    List<F> nbgs = MapField.getFields();
    
  • edges (around the field)
    List<E> edges = mapField.getEdges();
    
  • points (outline and center)
    List<N> points = mapField.getNodes();
    
  • a Shape that represents the graphic:
    this shape should be used for any drawing tasks
    Shape shape = getShape();
    
Edges have:
  • A List of Nodes - always of size 2, these are start and end nodes
    N a = mapEdge.getNodes().get(0);
    N a = mapEdge.getNodes().get(1);
    
  • fields, the two field adjected to the edge (or only one if it is on the border)
    List<F> fields = mapEdge.getFields();
    
  • edges, whom they are connected to
    List<E> edges = mapEdge.getEdges();
    
  • a Line that represents the graphic:
    this line should be used for any drawing tasks
    Line line = getLine();
    
Nodes have:
  • MapEdges to which they are connected
    List<E> edges = mapPoint.getEdges();
    
  • Fields to which they are connected
    List<F> fields = mapPoint.getFields();
    
  • a Point that represents the graphic:
    this point should be used for any drawing tasks
    Point point = getPoint();
    
Nodes have:

all data types can be parametrized and have getters/setters for the customizable objects

API

the map library provides expected basic functionality

  • access to all data fields
  • access to Data Types on x/y - position (either field, edge or point) - very helpful for GUIs, see example implementaion
  • A* (aStar) search on a field-based path (edge-based is planned for further releases)

Example / Tutorial

this screen shot is taken from the example of the map-library:

screenshot

Requirements:

Версии библиотеки

Версия
0.2.0
0.1.0