com.micello.mapapi.data
Class MapPoint

java.lang.Object
  extended by com.micello.mapapi.data.MapPoint
All Implemented Interfaces:
PointReference

public class MapPoint
extends java.lang.Object
implements PointReference

This class implements the PointReference interface, defining a point in terms of map coordinates and the level in terms of the level id. Map coordinates are like pixels when the zoom scale is set to 1.


Field Summary
 
Fields inherited from interface com.micello.mapapi.data.PointReference
ADDRESS_GEOM_TYPE, ID_GEOM_TYPE, LAT_LON_POINT_TYPE, MAP_POINT_TYPE
 
Constructor Summary
MapPoint(float x, float y, int lid)
          Constructor
 
Method Summary
 int getLevelId()
          This method returns the level id.
 float[] getXY()
          This method returns the XY.
 float[] getXY(DrawingLevel level)
          This method is intended for internal use.
 boolean isOnLevel(DrawingLevel level)
          This method is intended for internal use.
static MapPoint load(JSONArray json)
          This method loads a map point from a JSON object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapPoint

public MapPoint(float x,
                float y,
                int lid)
Constructor

Parameters:
x - The X location in map coordinates
y - The Y location in map coordinates
lid - The micello level ID for the level
Method Detail

getXY

public float[] getXY(DrawingLevel level)
This method is intended for internal use. It returns the map coordinates for the point as defined by the drawing set in the isOnLevel call.

Specified by:
getXY in interface PointReference

isOnLevel

public boolean isOnLevel(DrawingLevel level)
This method is intended for internal use. It returns true if the point is on the given level.

Specified by:
isOnLevel in interface PointReference
Parameters:
level - The level on shich to check if the point resides.
Returns:
True if the point is on the level.

getXY

public float[] getXY()
This method returns the XY. No level is needed fo retrieve the xy from a MapPoint.


getLevelId

public int getLevelId()
This method returns the level id.


load

public static MapPoint load(JSONArray json)
                     throws java.lang.Exception
This method loads a map point from a JSON object.

Throws:
java.lang.Exception