Using the GIS Point, you can define a point on the map, e.g. a city, or some point of destination. You can put it anywhere on the map. Each GIS point that you create has the latitude and longitude coordinates, defined in degrees.
You can add GIS Point element only into the GIS map. Add GIS map shape first to your model before you use GIS markup elements.
To add a point onto the map
- Creating a GIS point using the search menu is the simplest way to add a GIS point to the map. You can convert search results to GIS points in one click. Such a GIS point will also have its title automatically filled with the full address of the location.
- Alternatively, drag the GIS Point element from the GIS section of the Space Markup palette onto the GIS map. When you start dragging the point, you will see that the graphical editor becomes grayed out and unavailable to place a GIS point; the map remains highlighted.
- You can select the point on the map to change its location or properties. If you are then editing the map, like panning or zooming, the GIS point will stay in its latitude and longitude.
You can easily customize the GIS points you add onto the map: you can change the fill and line colors, or a radius of some point. Then, in design-time, the points will look like shown in the figure below:
In the model run-time you will get these points on the map:
- General
-
Name — The name of the GIS point. The name is used to identify and access the point from code.
Ignore — If selected, the point is excluded from the model.
Visible — Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.
Lock the position — If this option is selected, the shape’s position on the map is fixed. The shape cannot be moved, but you can select it to change other properties.
Title — Here you can type the title for this point. The title that you can define in this field is accessible in the run-time via API. When you convert a search result to create a GIS point, its title will be automatically filled with the address of that location.
- Appearance
- These properties apply to the point itself.
Fill color — GIS point’s fill color. Choose No Fill, if you do not want a point to be filled.
Line color — Outline color. Choose No Color, if you do not want outline to be drawn.
Line width — Outline width.
Line style — Outline style. Choose from the drop-down list, whether you want solid, dashed, or dotted outline to be drawn.
- Position and size
-
Latitude, deg — The latitude of the point on the map, measured in degrees (-90 ... (South) ... 0 ... (North) ... 90).
Longitude, deg — The longitude of the point on the map, measured in degrees (-180 ... (South) ... 0 ... (North) ... 180).
Radius — The radius of the point.
You can dynamically modify GIS point’s properties at model runtime using the following API.
- General
-
Function Description String getTitle() Returns the title of the GIS point. void setTitle(String title) Sets a new title to the GIS point.
title — a new title.boolean isVisible() Returns true if the element is visible; returns false otherwise. void setVisible(boolean v) Sets the visibility of the markup element.
v- visibility: true — visible, false — not.INetwork getNetwork() Returns the GIS network this markup element belongs to or null if this element is not a part of a network. GISRoute getConnection(int index) Returns the GIS route with the provided index, which connects this GIS node with another GIS node.
index — the index of the required connection in range (0, this.getConnectionsCount() - 1)int getConnectionsCount() Returns the number of this GIS node’s connections to other GIS nodes. - Location
-
Function Description double getLatitude()
double getLongitude()Return the latitude and longitude coordinates of the point. Point getLocation() Returns the (latitude, longitude) of this GIS point. Point getLocation(Point out) Returns the (latitude, longitude) of this GIS point. The result is written to the provided out object if not null.
out — the Point object to write to, may be null. - Distance
-
Function Description double distance(double latitude, double longitude) Calculates the distance from this point to another point, in meters.
latitude — the latitude of the point.
longitude — the longitude of the point.double distance(double latitude, double longitude, LengthUnits units) Calculates the distance from this point to another point, in the given length units.
latitude — the latitude of the point.
longitude — the longitude of the point.
units — the units of length.double distance(GISPoint givenPoint) Calculates the distance from this point to another point, in meters.
givenPoint — the point the distance to which you need to calculate.double distance(GISPoint givenPoint, LengthUnits units) Calculates the distance from this point to another point, in given length units.
givenPoint — the point the distance to which you need to calculate.
units — the units of length.double getNearestPoint(double lat, double lon, Point out) Returns the distance (in meters) to the nearest point.
lat — the latitude of the point.
lon — the longitude of the point.
out — the output point to write result to.double getNearestPoint(Point givenPoint, Point out) Calculates (using the output object) the point in this space markup element nearest to the given point. Returns the square of the distance to the point.
givenPoint — the GIS point the distance to which you need to calculate.
out — the output Point to write result to. - Appearance
-
Function Description double getRadius() Returns radius of the circle of this GIS point, measured in pixels. void setRadius(int radius) Dynamically sets the radius of the GIS point.
radius — measured in pixels.Color getFillColor() Returns the fill color of the shape, or null if the shape has no fill color or has textured fill (in this case getFillTexture() should be used instead). void setFillColor(Paint color) Sets the fill color (or Texture) of the shape.
fillColor — the new fill color, null — no fill color.Texture getFillTexture() Returns the fill texture of the shape, if the shape has fill texture. Color getLineColor() Returns the color of the markup element’s outline, or null if the markup element has no line color. void setLineColor(Paint lineColor) Sets the color (or Texture) of the markup element’s outline.
lineColor — the new line color, null — do not draw the markup element line.void setLineStyle(LineStyle lineStyle) Sets the line style of the markup element.
lineStyle — the new style of the markup element. Valid values:
LINE_STYLE_SOLID, LINE_STYLE_DOTTED, LINE_STYLE_DASHED.
LineStyle getLineStyle() Returns the line style of the markup element.
Valid values:
LINE_STYLE_SOLID
LINE_STYLE_DOTTED
LINE_STYLE_DASHEDdouble getLineWidth() Returns the line width of the markup element. void setLineWidth(double width) Sets the line width of the markup element, 0 means the thinnest possible line.
width — the new line width of the markup element. - Removal
-
Function Description void remove() Removes the GIS point from the presentation. If the GIS point is not a part of presentation, the function does nothing. Removal from the presentation does not necessarily mean removing from the model logic, since logical networks and routes may have been created before the removal and survive it.
-
How can we improve this article?
-