Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
265fe4bb
Commit
265fe4bb
authored
Dec 27, 2017
by
Evan W. Patton
Committed by
Jeffrey Schiller
Dec 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update maps documentation based on Hedge's feedback (#1072)
Change-Id: I8f2cfd0ad5d511beb1eea626538b9ed607d94696
parent
f77187cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
88 deletions
+88
-88
appinventor/docs/reference/components/maps.html
appinventor/docs/reference/components/maps.html
+88
-88
No files found.
appinventor/docs/reference/components/maps.html
View file @
265fe4bb
...
@@ -498,33 +498,33 @@
...
@@ -498,33 +498,33 @@
longitude. The circle's appearnce can be customized using properties such
longitude. The circle's appearnce can be customized using properties such
as
<a
href=
"#Circle.FillColor"
><code>
FillColor
</code></a>
,
<a
href=
"#Circle.StrokeColor"
><code>
StrokeColor
</code></a>
,
as
<a
href=
"#Circle.FillColor"
><code>
FillColor
</code></a>
,
<a
href=
"#Circle.StrokeColor"
><code>
StrokeColor
</code></a>
,
and
<a
href=
"#Circle.StrokeWidth"
><code>
StrokeWidth
</code></a>
.
</p>
and
<a
href=
"#Circle.StrokeWidth"
><code>
StrokeWidth
</code></a>
.
</p>
<p>
Circle can also be used to implement features such as geofencing, a mechanism where the user's
<p>
The Circle component can also be used to implement features such as geofencing, a mechanism where
presence within an area is used to trigger other behaviors. Using
the user's
presence within an area is used to trigger other behaviors. Using
the
<a
href=
"#Circle.DistanceToPoint"
><code>
DistanceToPoint
</code></a>
method combined with
the
<a
href=
"#Circle.DistanceToPoint"
><code>
DistanceToPoint
</code></a>
method combined with
the
<a
href=
"sensors.html#LocationSensor"
>
LocationSensor
</a>
,
one can detect
whether a user's
the
<a
href=
"sensors.html#LocationSensor"
>
LocationSensor
</a>
,
you can determine
whether a user's
location is inside or outside
the circle to trigger additional app behavior
.
</p>
location is inside or outside
of the circle. You can use this feature to trigger additional actions
.
</p>
<h3>
Properties
</h3>
<h3>
Properties
</h3>
<dl>
<dl>
<dt
class=
"text"
id=
"Circle.Description"
>
Description
<i></i></dt>
<dt
class=
"text"
id=
"Circle.Description"
>
Description
<i></i></dt>
<dd>
Sets or gets the description displayed in the info window
that appears when the user taps on the
<dd>
Sets or gets the description displayed in the info window
. The info window appears when the user
circle.
</dd>
taps on the
circle.
</dd>
<dt
class=
"boolean"
id=
"Circle.Draggable"
>
Draggable
<i></i></dt>
<dt
class=
"boolean"
id=
"Circle.Draggable"
>
Draggable
<i></i></dt>
<dd>
Sets or gets whether or not the user can drag a map feature
by long-pressing and then dragging
<dd>
Sets or gets whether or not the user can drag a map feature
. This feature is accessed by
the circle to a new location.
</dd>
long-pressing and then dragging
the circle to a new location.
</dd>
<dt
class=
"boolean"
id=
"Circle.EnableInfobox"
>
EnableInfobox
<i></i></dt>
<dt
class=
"boolean"
id=
"Circle.EnableInfobox"
>
EnableInfobox
<i></i></dt>
<dd>
Enables or disables the infobox window display when the user taps the circle.
</dd>
<dd>
Enables or disables the infobox window display when the user taps the circle.
</dd>
<dt
class=
"color"
id=
"Circle.FillColor"
>
FillColor
<i></i></dt>
<dt
class=
"color"
id=
"Circle.FillColor"
>
FillColor
<i></i></dt>
<dd>
Sets or gets the color used to fill in the circle.
</dd>
<dd>
Sets or gets the color used to fill in the circle.
</dd>
<dt
class=
"number"
id=
"Circle.Latitude"
>
Latitude
<i></i></dt>
<dt
class=
"number"
id=
"Circle.Latitude"
>
Latitude
<i></i></dt>
<dd>
Sets or gets the latitude of the center of the circle, in degrees
, with positive values
<dd>
Sets or gets the latitude of the center of the circle, in degrees
. Positive values representing
representing north of the equator and negative values representing south of the equator. To updat
e
north of the equator and negative values representing south of the equator. To update the latitud
e
the latitude and longitude simultaneously, use
and longitude simultaneously, use the
<a
href=
"#Circle.SetLocation"
><code>
SetLocation
</code></a>
the
<a
href=
"#Circle.SetLocation"
><code>
SetLocation
</code></a>
method.
</dd>
method.
</dd>
<dt
class=
"number"
id=
"Circle.Longitude"
>
Longitude
<i></i></dt>
<dt
class=
"number"
id=
"Circle.Longitude"
>
Longitude
<i></i></dt>
<dd>
Sets or gets the longitude of the center of the circle, in degrees
, with positive values
<dd>
Sets or gets the longitude of the center of the circle, in degrees
. Positive values representing
representing east of the prime meridian and negative values representing west of the prim
e
east of the prime meridian and negative values representing west of the prime meridian. To updat
e
meridian. To update
the latitude and longitude simultaneously, use
the latitude and longitude simultaneously, use
the
<a
href=
"#Circle.SetLocation"
><code>
SetLocation
</code></a>
method.
</dd>
the
<a
href=
"#Circle.SetLocation"
><code>
SetLocation
</code></a>
method.
</dd>
<dt
class=
"number"
id=
"Circle.Radius"
>
Radius
<i></i></dt>
<dt
class=
"number"
id=
"Circle.Radius"
>
Radius
<i></i></dt>
<dd>
Sets or gets the radius of the circle, in meters.
</dd>
<dd>
Sets or gets the radius of the circle, in meters.
</dd>
...
@@ -551,9 +551,9 @@
...
@@ -551,9 +551,9 @@
<dd>
Runs after the user long clicks on the circle but does not trigger a drag. Note that this event
<dd>
Runs after the user long clicks on the circle but does not trigger a drag. Note that this event
will only trigger if
<a
href=
"#Circle.Draggable"
><code>
Draggable
</code></a>
is false.
</dd>
will only trigger if
<a
href=
"#Circle.Draggable"
><code>
Draggable
</code></a>
is false.
</dd>
<dt
id=
"Circle.StartDrag"
>
StartDrag
</dt>
<dt
id=
"Circle.StartDrag"
>
StartDrag
</dt>
<dd>
Runs before a drag operation begins.
</dd>
<dd>
Runs before a drag operation begins.
Use this to save the current position of the circle, for example.
</dd>
<dt
id=
"Circle.StopDrag"
>
StopDrag
</dt>
<dt
id=
"Circle.StopDrag"
>
StopDrag
</dt>
<dd>
Runs after a drag operation completes.
</dd>
<dd>
Runs after a drag operation completes.
Use this to save the new position of the circle, for example.
</dd>
</dl>
</dl>
<h3>
Methods
</h3>
<h3>
Methods
</h3>
...
@@ -571,7 +571,7 @@
...
@@ -571,7 +571,7 @@
to the given point. Further, this method will return 0 if
<code>
centroids
</code>
is false and the
to the given point. Further, this method will return 0 if
<code>
centroids
</code>
is false and the
point is in the circle. If an error occurs, -1 will be returned.
</dd>
point is in the circle. If an error occurs, -1 will be returned.
</dd>
<dt
id=
"Circle.HideInfoBox"
>
HideInfobox
</dt>
<dt
id=
"Circle.HideInfoBox"
>
HideInfobox
</dt>
<dd>
Hides the circle's info box if it is visible. Otherwise,
this method has no effect
.
</dd>
<dd>
Hides the circle's info box if it is visible. Otherwise,
no action is taken
.
</dd>
<dt
id=
"Circle.SetLocation"
>
SetLocation(number latitude, number longitude)
</dt>
<dt
id=
"Circle.SetLocation"
>
SetLocation(number latitude, number longitude)
</dt>
<dd>
Moves the center of the circle to the given latitude and longitude. This method is more efficient
<dd>
Moves the center of the circle to the given latitude and longitude. This method is more efficient
than setting latitude and longitude separately.
</dd>
than setting latitude and longitude separately.
</dd>
...
@@ -582,9 +582,9 @@
...
@@ -582,9 +582,9 @@
</dl>
</dl>
<h2
id=
"FeatureCollection"
>
FeatureCollection
</h2>
<h2
id=
"FeatureCollection"
>
FeatureCollection
</h2>
<p>
A FeatureCollection
contains one or more map features as a group. Any events that occur o
n a
<p>
A FeatureCollection
groups one or more map features together. Any events that occur withi
n a
feature in the collection will also trigger the cor
esponding event o
n the collection
feature in the collection will also trigger the cor
responding event i
n the collection
component. FeatureCollections can be loaded from exernal resources
as a means of populating a Map
component. FeatureCollections can be loaded from exernal resources
to populate Maps
with content. GeoJSON is the only format supported at this time.
</p>
with content. GeoJSON is the only format supported at this time.
</p>
<h3>
Properties
</h3>
<h3>
Properties
</h3>
...
@@ -592,7 +592,7 @@
...
@@ -592,7 +592,7 @@
<dt
class=
"list"
id=
"FeatureCollection.Features"
>
Features
<i></i></dt>
<dt
class=
"list"
id=
"FeatureCollection.Features"
>
Features
<i></i></dt>
<dd>
Returns a list of features present in the feature collection, if any.
</dd>
<dd>
Returns a list of features present in the feature collection, if any.
</dd>
<dt
class=
"text wo"
id=
"FeatureCollection.FeaturesFromGeoJSON"
>
FeaturesFromGeoJSON
<i></i></dt>
<dt
class=
"text wo"
id=
"FeatureCollection.FeaturesFromGeoJSON"
>
FeaturesFromGeoJSON
<i></i></dt>
<dd>
Populates the feature collection fro a string containing GeoJSON content. Given the size of such
<dd>
Populates the feature collection fro
m
a string containing GeoJSON content. Given the size of such
strings, it is recommended to load the feature collection from assets or the web using the Source
strings, it is recommended to load the feature collection from assets or the web using the Source
property.
</dd>
property.
</dd>
<dt
class=
"text ro"
id=
"FeatureCollection.Source"
>
Source
<i></i></dt>
<dt
class=
"text ro"
id=
"FeatureCollection.Source"
>
Source
<i></i></dt>
...
@@ -606,20 +606,20 @@
...
@@ -606,20 +606,20 @@
<dl>
<dl>
<dt
id=
"FeatureCollection.FeatureClick"
>
FeatureClick(component feature)
</dt>
<dt
id=
"FeatureCollection.FeatureClick"
>
FeatureClick(component feature)
</dt>
<dd>
When a feature is clicked, the feature collection containing it (if any) will also receive a
<dd>
When a feature is clicked, the feature collection containing it (if any) will also receive a
FeatureClick
event. The feature parameter indicates which child feature was clicked.
</dd>
<code>
FeatureClick
</code>
event. The feature parameter indicates which child feature was clicked.
</dd>
<dt
id=
"FeatureCollection.FeatureDrag"
>
FeatureDrag(component feature)
</dt>
<dt
id=
"FeatureCollection.FeatureDrag"
>
FeatureDrag(component feature)
</dt>
<dd>
When a feature is dragged, the
feature collection containing it (if any) will also receive a
<dd>
When a feature is dragged, the
parent collection will also receive a
<code>
FeatureDrag
</code>
FeatureDrag
event. The feature parameter indicates which child feature was dragged.
</dd>
event. The feature parameter indicates which child feature was dragged.
</dd>
<dt
id=
"FeatureCollection.FeatureLongClick"
>
FeatureLongClick(component feature)
</dt>
<dt
id=
"FeatureCollection.FeatureLongClick"
>
FeatureLongClick(component feature)
</dt>
<dd>
When a feature is long clicked, the
feature collection containing it (if any)
will also receive a
<dd>
When a feature is long clicked, the
parent collection
will also receive a
FeatureLongClick
event. The feature parameter indicates which child feature was long clicked.
</dd>
<code>
FeatureLongClick
</code>
event. The feature parameter indicates which child feature was long clicked.
</dd>
<dt
id=
"FeatureCollection.FeatureStartDrag"
>
FeatureStartDrag(component feature)
</dt>
<dt
id=
"FeatureCollection.FeatureStartDrag"
>
FeatureStartDrag(component feature)
</dt>
<dd>
When the user begins dragging a feature, the
feature collection containing it (if any) will also
<dd>
When the user begins dragging a feature, the
parent collection will also receive
receive a FeatureStartDrag
event. The feature parameter indicates which child feature was
a
<code>
FeatureStartDrag
</code>
event. The feature parameter indicates which child feature was
dragged.
</dd>
dragged.
</dd>
<dt
id=
"FeatureCollection.FeatureStopDrag"
>
FeatureStopDrag(component feature)
</dt>
<dt
id=
"FeatureCollection.FeatureStopDrag"
>
FeatureStopDrag(component feature)
</dt>
<dd>
When the user stops dragging a feature, the
feature collection containing it (if any) will also
<dd>
When the user stops dragging a feature, the
parent collection will also receive
receive a FeatureStopDrag
event. The feature parameter indicates which child feature was
a
<code>
FeatureStopDrag
</code>
event. The feature parameter indicates which child feature was
dragged.
</dd>
dragged.
</dd>
<dt
id=
"FeatureCollection.GotFeatures"
>
GotFeatures(text url, list features)
</dt>
<dt
id=
"FeatureCollection.GotFeatures"
>
GotFeatures(text url, list features)
</dt>
<dd>
The GotFeatures event is run when when a feature collection is successfully read from the
<dd>
The GotFeatures event is run when when a feature collection is successfully read from the
...
@@ -637,7 +637,7 @@
...
@@ -637,7 +637,7 @@
<dl>
<dl>
<dt
id=
"FeatureCollection.FeatureFromDescription"
>
any FeatureFromDescription(list description)
</dt>
<dt
id=
"FeatureCollection.FeatureFromDescription"
>
any FeatureFromDescription(list description)
</dt>
<dd>
Returns a new component based on the description provided. If there is an error in the
<dd>
Returns a new component based on the description provided. If there is an error in the
properties, such as
a malformed geometry
, then the method will return text describing the
properties, such as
incorrectly formatted data
, then the method will return text describing the
error. Use
error. Use
the
<a
href=
"http://appinventor.mit.edu/explore/ai2/support/blocks/text.html#istext"
><code>
is-text?
</code></a>
the
<a
href=
"http://appinventor.mit.edu/explore/ai2/support/blocks/text.html#istext"
><code>
is-text?
</code></a>
block to test whether the result is an error message. is an error or not. Properties of features
block to test whether the result is an error message. is an error or not. Properties of features
...
@@ -663,7 +663,7 @@
...
@@ -663,7 +663,7 @@
<h2
id=
"LineString"
>
LineString
</h2>
<h2
id=
"LineString"
>
LineString
</h2>
<p>
LineString is a component for drawing an open, conti
g
uous sequence of lines on a Map. To add new
<p>
LineString is a component for drawing an open, conti
n
uous sequence of lines on a Map. To add new
points to a LineString, drag the midpoint of any segment away from the line to introduce a new
points to a LineString, drag the midpoint of any segment away from the line to introduce a new
vertex. Move a vertex by clicking and dragging the vertex to a new location. Clicking on a vertex
vertex. Move a vertex by clicking and dragging the vertex to a new location. Clicking on a vertex
will delete the vertex.
</p>
will delete the vertex.
</p>
...
@@ -690,7 +690,7 @@
...
@@ -690,7 +690,7 @@
<dt
class=
"text"
id=
"LineString.Title"
>
Title
<i></i></dt>
<dt
class=
"text"
id=
"LineString.Title"
>
Title
<i></i></dt>
<dd>
The title displayed in the info window that appears when the user clicks on the map feature.
</dd>
<dd>
The title displayed in the info window that appears when the user clicks on the map feature.
</dd>
<dt
class=
"text ro"
id=
"LineString.Type"
>
Type
<i></i></dt>
<dt
class=
"text ro"
id=
"LineString.Type"
>
Type
<i></i></dt>
<dd>
T
he type of the feature. For LineString, this will always be
"
LineString
"
,
</dd>
<dd>
Gets t
he type of the feature. For LineString, this will always be
"
LineString
"
,
</dd>
<dt
class=
"boolean"
id=
"LineString.Visible"
>
Visible
<i></i></dt>
<dt
class=
"boolean"
id=
"LineString.Visible"
>
Visible
<i></i></dt>
<dd>
Specifies whether the component should be visible on the screen. Value is true if the component
<dd>
Specifies whether the component should be visible on the screen. Value is true if the component
is showing and false if hidden.
</dd>
is showing and false if hidden.
</dd>
...
@@ -699,7 +699,7 @@
...
@@ -699,7 +699,7 @@
<h3>
Events
</h3>
<h3>
Events
</h3>
<dl>
<dl>
<dt
id=
"LineString.Click"
>
Click
</dt>
<dt
id=
"LineString.Click"
>
Click
</dt>
<dd>
Runs when the user taps on
the line string (within a given threshold)
.
</dd>
<dd>
Runs when the user taps on
or very close to the line string
.
</dd>
<dt
id=
"LineString.Drag"
>
Drag
</dt>
<dt
id=
"LineString.Drag"
>
Drag
</dt>
<dd>
Runs during a drag operation.
</dd>
<dd>
Runs during a drag operation.
</dd>
<dt
id=
"LineString.LongClick"
>
LongClick
</dt>
<dt
id=
"LineString.LongClick"
>
LongClick
</dt>
...
@@ -742,7 +742,7 @@
...
@@ -742,7 +742,7 @@
allows for multiple Marker elements to identify points on the map. Map tiles are supplied
allows for multiple Marker elements to identify points on the map. Map tiles are supplied
by OpenStreetMap contributors and the United States Geological Survey.
</p>
by OpenStreetMap contributors and the United States Geological Survey.
</p>
<p>
The Map component provides three utilities for manipulating its boundaries within App
<p>
The Map component provides three utilities for manipulating its boundaries within App
Inventor. First, a locking mechanism
is provided to allow
the map to be moved relative to
Inventor. First, a locking mechanism
allows
the map to be moved relative to
other components on the Screen. Second, when unlocked, the user can pan the Map to any
other components on the Screen. Second, when unlocked, the user can pan the Map to any
location. At this new location, the
"
Set Initial Boundary
"
button can be pressed
location. At this new location, the
"
Set Initial Boundary
"
button can be pressed
to save the current Map coordinates to its properties. Lastly, if the Map is moved to a
to save the current Map coordinates to its properties. Lastly, if the Map is moved to a
...
@@ -752,8 +752,8 @@
...
@@ -752,8 +752,8 @@
<h3>
Properties
</h3>
<h3>
Properties
</h3>
<dl>
<dl>
<dt
class=
"list bo"
id=
"Map.BoundingBox"
>
BoundingBox
<i></i></dt>
<dt
class=
"list bo"
id=
"Map.BoundingBox"
>
BoundingBox
<i></i></dt>
<dd>
Sets or gets the
bounding box for the map. The value is a list of lists containing the northwest
<dd>
Sets or gets the
current boundary for the map's drawn view. The value is a list of lists
and southeast coordinates of the Map
view in the
containing the northwest and southeast coordinates of the current
view in the
form
<code>
((North
West)
(South
East))
</code>
.
</dd>
form
<code>
((North
West)
(South
East))
</code>
.
</dd>
<dt
class=
"text wo"
id=
"Map.CenterFromString"
>
CenterFromString
<i></i></dt>
<dt
class=
"text wo"
id=
"Map.CenterFromString"
>
CenterFromString
<i></i></dt>
<dd>
Sets the center of the map from a given
"
latitude, longitude
"
string. This is used
<dd>
Sets the center of the map from a given
"
latitude, longitude
"
string. This is used
...
@@ -792,8 +792,8 @@
...
@@ -792,8 +792,8 @@
and accuracy of this feature will depend on whether the user has location services enabled and which
and accuracy of this feature will depend on whether the user has location services enabled and which
location providers are available.
</dd>
location providers are available.
</dd>
<dt
class=
"boolean"
id=
"Map.ShowZoom"
>
ShowZoom
<i></i></dt>
<dt
class=
"boolean"
id=
"Map.ShowZoom"
>
ShowZoom
<i></i></dt>
<dd>
Shows or hides the Android native zoom buttons to allow the user to zoom the Map in or out
<dd>
Shows or hides the Android native zoom buttons to allow the user to zoom the Map in or out
. This
instead of using
the two-finger pinch-to-zoom gesture.
</dd>
can be used in place of
the two-finger pinch-to-zoom gesture.
</dd>
<dt
class=
"number ro bo"
id=
"Map.UserLatitude"
>
UserLatitude
<i></i></dt>
<dt
class=
"number ro bo"
id=
"Map.UserLatitude"
>
UserLatitude
<i></i></dt>
<dd>
Returns the user's latitude if ShowUser is enabled.
</dd>
<dd>
Returns the user's latitude if ShowUser is enabled.
</dd>
<dt
class=
"number ro bo"
id=
"Map.UserLongitude"
>
UserLongitude
<i></i></dt>
<dt
class=
"number ro bo"
id=
"Map.UserLongitude"
>
UserLongitude
<i></i></dt>
...
@@ -806,7 +806,7 @@
...
@@ -806,7 +806,7 @@
<dd>
Sets the Width of the Map to a percentage of the Screen.
</dd>
<dd>
Sets the Width of the Map to a percentage of the Screen.
</dd>
<dt
class=
"number"
id=
"Map.ZoomLevel"
>
ZoomLevel
<i></i></dt>
<dt
class=
"number"
id=
"Map.ZoomLevel"
>
ZoomLevel
<i></i></dt>
<dd>
Gets or sets the zoom level for the Map. Valid values range from 1-20. Not all tile layers will
<dd>
Gets or sets the zoom level for the Map. Valid values range from 1-20. Not all tile layers will
support
all zoom levels at all locations
. For example, detailed aerial photography is likely not
support
each zoom level at every location
. For example, detailed aerial photography is likely not
available for tiles in the middle of the ocean or at the poles. Highest zoom levels will likely
available for tiles in the middle of the ocean or at the poles. Highest zoom levels will likely
occur in major city centers due to the amount of detailed data available.
</dd>
occur in major city centers due to the amount of detailed data available.
</dd>
</dl>
</dl>
...
@@ -821,50 +821,51 @@
...
@@ -821,50 +821,51 @@
may be followed by a
<a
href=
"#Map.ZoomChange"
><code>
ZoomChange
</code></a>
event if zooming
may be followed by a
<a
href=
"#Map.ZoomChange"
><code>
ZoomChange
</code></a>
event if zooming
gestures are enabled and the map is not at the highest possible zoom level.
</dd>
gestures are enabled and the map is not at the highest possible zoom level.
</dd>
<dt
id=
"Map.FeatureClick"
>
FeatureClick(component feature)
</dt>
<dt
id=
"Map.FeatureClick"
>
FeatureClick(component feature)
</dt>
<dd>
When a feature is clicked, the
map containing it will also receive a FeatureClick event. The
<dd>
When a feature is clicked, the
parent map will also receive a
<code>
FeatureClick
</code>
<code>
feature
</code>
parameter indicates which child feature was clicked.
</dd>
event. The
<code>
feature
</code>
parameter indicates which child feature was clicked.
</dd>
<dt
id=
"Map.FeatureDrag"
>
FeatureDrag(component feature)
</dt>
<dt
id=
"Map.FeatureDrag"
>
FeatureDrag(component feature)
</dt>
<dd>
When a feature is dragged, the
map containing it will also receive a FeatureDrag
event. The
<dd>
When a feature is dragged, the
parent map will also receive a
<code>
FeatureDrag
</code>
event. The
<code>
feature
</code>
parameter indicates which child feature was dragged.
</dd>
<code>
feature
</code>
parameter indicates which child feature was dragged.
</dd>
<dt
id=
"Map.FeatureLongClick"
>
FeatureLongClick(component feature)
</dt>
<dt
id=
"Map.FeatureLongClick"
>
FeatureLongClick(component feature)
</dt>
<dd>
When a feature is long clicked, the
map containing it will also receive a FeatureLongClick
<dd>
When a feature is long clicked, the
parent map will also receive a
<code>
FeatureLongClick
</code>
event. The
<code>
feature
</code>
parameter indicates which child feature was long clicked.
</dd>
event. The
<code>
feature
</code>
parameter indicates which child feature was long clicked.
</dd>
<dt
id=
"Map.FeatureStartDrag"
>
FeatureStartDrag(component feature)
</dt>
<dt
id=
"Map.FeatureStartDrag"
>
FeatureStartDrag(component feature)
</dt>
<dd>
When the user begins dragging a feature, the
map containing it
will also receive a
<dd>
When the user begins dragging a feature, the
parent map
will also receive a
FeatureStartDrag event. The
<code>
feature
</code>
parameter indicates which child feature was
<code>
FeatureStartDrag
</code>
event. The
<code>
feature
</code>
parameter indicates which child
dragged.
</dd>
feature was
dragged.
</dd>
<dt
id=
"Map.FeatureStopDrag"
>
FeatureStopDrag(component feature)
</dt>
<dt
id=
"Map.FeatureStopDrag"
>
FeatureStopDrag(component feature)
</dt>
<dd>
When the user stops dragging a feature, the map containing it will also receive a FeatureStopDrag
<dd>
When the user stops dragging a feature, the parent map will also receive
event. The
<code>
feature
</code>
parameter indicates which child feature was dragged.
</dd>
a
<code>
FeatureStopDrag
</code>
event. The
<code>
feature
</code>
parameter indicates which child
<dt
id=
"Map.GeoJSONError"
>
GeoJSONError(text url, number responseCode, text errorMessage)
</dt>
feature was dragged.
</dd>
<dd>
The GeoJSONError event is run when an error occurs while processing a GeoJSON document at the
given
<code>
url
</code>
. The
<code>
responseCode
</code>
parameter will contain an HTTP status code and
the
<code>
errorMessage
</code>
parameter will contain a detailed error message.
</dd>
<dt
id=
"Map.GotFeatures"
>
GotFeatures(text url, list features)
</dt>
<dt
id=
"Map.GotFeatures"
>
GotFeatures(text url, list features)
</dt>
<dd>
The GotFeatures event is run when when a feature collection is successfully read from the
<dd>
The
<code>
GotFeatures
</code>
event runs after a call
given
<code>
url
</code>
. The
<code>
features
</code>
parameter will be a list of feature descriptions
to
<a
href=
"#Map.LoadFromURL"
><code>
LoadFromURL
</code></a>
successfully reads feature description
from
<code>
url
</code>
. The
<code>
features
</code>
parameter will be a list of feature descriptions
that can be converted into components using
that can be converted into components using
the
<a
href=
"#FeatureCollection.FeatureFromDescription"
><code>
FeatureFromDescription
</code></a>
the
<a
href=
"#FeatureCollection.FeatureFromDescription"
><code>
FeatureFromDescription
</code></a>
method.
</dd>
method.
</dd>
<dt
id=
"Map.InvalidPoint"
>
InvalidPoint(text message)
</dt>
<dt
id=
"Map.InvalidPoint"
>
InvalidPoint(text message)
</dt>
<dd>
Runs when an invalid point is encounter while processing geographical data. Points are considered
<dd>
Runs when the program encounters an invalid point while processing geographical data. Points are
bad when the latitude or longitude for the point is outside the acceptable range ([-90, 90] and
considered invalid when the latitude or longitude for the point is outside the acceptable range ([-90,
[-180, 180], respectively). The
<code>
message
</code>
parameter will contain an explanation for the
90] and [-180, 180], respectively). The
<code>
message
</code>
parameter will contain an explanation
error.
</dd>
for the error.
</dd>
<dt
id=
"Map.LoadError"
>
LoadError(text url, number responseCode, text errorMessage)
</dt>
<dd>
The LoadError event runs when processing a feature collection document at the
given
<code>
url
</code>
produces an error. The
<code>
responseCode
</code>
parameter will contain an
HTTP status code and the
<code>
errorMessage
</code>
parameter will contain a detailed error
message.
</dd>
<dt
id=
"Map.LongPressAtPoint"
>
LongPressAtPoint(number latitude, number longitude)
</dt>
<dt
id=
"Map.LongPressAtPoint"
>
LongPressAtPoint(number latitude, number longitude)
</dt>
<dd>
Runs when the user long presses a point on the map. The location at which the long press occurred
<dd>
Runs when the user long presses a point on the map.
<code>
Latitude
</code>
will be reported in map coordinates via the
<code>
latitude
</code>
and
<code>
longitude
</code>
and
<code>
longitude
</code>
indicate the location of the long press in map coordinates. Note that
parameters. Note that this event will not trigger
this event will not trigger if
<a
href=
"#Map.EnablePan"
><code>
EnablePan
</code></a>
is true as a
if
<a
href=
"#Map.EnablePan"
><code>
EnablePan
</code></a>
is true as a long press causes a panning
long press causes a panning event instead.
</dd>
event instead.
</dd>
<dt
id=
"Map.Ready"
>
Ready
</dt>
<dt
id=
"Map.Ready"
>
Ready
</dt>
<dd>
Runs when the map has
been initalized and is ready for user interaction
.
</dd>
<dd>
Runs when the map has
initalized and is ready for use
.
</dd>
<dt
id=
"Map.TapAtPoint"
>
TapAtPoint(number latitude, number longitude)
</dt>
<dt
id=
"Map.TapAtPoint"
>
TapAtPoint(number latitude, number longitude)
</dt>
<dd>
Runs when the user taps at a point on the map. The tapped location will be reported in map
<dd>
Runs when the user taps at a point on the map. The tapped location will be reported in map
coordinates via the
<code>
latitude
</code>
and
<code>
longitude
</code>
parameters.
</dd>
coordinates via the
<code>
latitude
</code>
and
<code>
longitude
</code>
parameters.
</dd>
<dt
id=
"Map.ZoomChange"
>
ZoomChange
</dt>
<dt
id=
"Map.ZoomChange"
>
ZoomChange
</dt>
<dd>
Runs when the user changes the zoom level, such as through a pinch gesture or double-tapping to
<dd>
Runs when the user changes the zoom level, such as through a pinch gesture or double-tapping.
</dd>
zoom.
</dd>
</dl>
</dl>
<h3>
Methods
</h3>
<h3>
Methods
</h3>
...
@@ -874,11 +875,11 @@
...
@@ -874,11 +875,11 @@
and
<code>
longitude
</code>
. The marker can be manipulated using the "any component" blocks.
</dd>
and
<code>
longitude
</code>
. The marker can be manipulated using the "any component" blocks.
</dd>
<dt
id=
"Map.FeatureFromDescription"
>
any FeatureFromDescription(list description)
</dt>
<dt
id=
"Map.FeatureFromDescription"
>
any FeatureFromDescription(list description)
</dt>
<dd>
Returns a new component based on the description provided. If there is an error in the
<dd>
Returns a new component based on the description provided. If there is an error in the
properties, such as
a malformed geometry
, then the method will return text describing the
properties, such as
incorrectly formatted data
, then the method will return text describing the
error. Use
error. Use
the
<a
href=
"http://appinventor.mit.edu/explore/ai2/support/blocks/text.html#istext"
><code>
is-text?
</code></a>
the
<a
href=
"http://appinventor.mit.edu/explore/ai2/support/blocks/text.html#istext"
><code>
is-text?
</code></a>
block to test whether
the result is an error message. is an error or not. Properties of featur
es
block to test whether
you get an error. Feature properties converted into App Inventor properti
es
are converted into App Inventor properties using the following case-insensi
tive mapping:
use the following case-insen
tive mapping:
<ul>
<ul>
<li>
description
→
Description
</li>
<li>
description
→
Description
</li>
<li>
draggable
→
Draggable
</li>
<li>
draggable
→
Draggable
</li>
...
@@ -892,10 +893,11 @@
...
@@ -892,10 +893,11 @@
</ul>
</ul>
</dd>
</dd>
<dt
id=
"Map.LoadFromURL"
>
LoadFromURL(text url)
</dt>
<dt
id=
"Map.LoadFromURL"
>
LoadFromURL(text url)
</dt>
<dd>
Call this method to load a GeoJSON description of a feature collection from a URL (including file
<dd>
Call this method to load a feature collection from a URL (including file URLs). If the event is
URLs). On success, the feature descriptions will be passed as a list to
successful, the feature descriptions are passed as a list to
the
<a
href=
"#Map.GotFeatures"
><code>
GotFeatures
</code></a>
event. On failure,
the
<a
href=
"#Map.GotFeatures"
><code>
GotFeatures
</code></a>
event. If it fails,
the
<a
href=
"#Map.GeoJSONError"
><code>
GeoJSONError
</code></a>
event will be run.
</dd>
the
<a
href=
"#Map.LoadError"
><code>
LoadError
</code></a>
event will be run. At this time, GeoJSON is
the only supported format.
</dd>
<dt
id=
"Map.PanTo"
>
PanTo(number latitude, number longitude, number zoom)
</dt>
<dt
id=
"Map.PanTo"
>
PanTo(number latitude, number longitude, number zoom)
</dt>
<dd>
Pans the map center to the given
<code>
(Latitude Longitude)
</code>
and zooms to the
<dd>
Pans the map center to the given
<code>
(Latitude Longitude)
</code>
and zooms to the
given
<code>
zoom
</code>
. The movement is animated.
</dd>
given
<code>
zoom
</code>
. The movement is animated.
</dd>
...
@@ -905,11 +907,10 @@
...
@@ -905,11 +907,10 @@
</dl>
</dl>
<h2
id=
"Marker"
>
Marker
</h2>
<h2
id=
"Marker"
>
Marker
</h2>
<p>
Marker is a component to indicate points on a Map, such as buildings or points of
<p>
The Marker component indicates points on a Map, such as buildings or points of interest. Markers
interest. Markers can be customized in many ways, including but not limited to using custom images
can be customized in many ways, such as using custom images from the app's assets. Markers can also
from the app's assets. Markers can also be created dynamically using
be created dynamically using the
<a
href=
"#Map.CreateMarker"
><code>
CreateMarker
</code></a>
method
the
<a
href=
"#Map.CreateMarker"
><code>
CreateMarker
</code></a>
method and further configured using
and configured using the "Any Component" blocks.
</p>
the "Any Component" advanced blocks.
</p>
<h3>
Properties
</h3>
<h3>
Properties
</h3>
<dl>
<dl>
...
@@ -923,7 +924,7 @@
...
@@ -923,7 +924,7 @@
<dd>
Sets or gets the description displayed in the info window that appears when the user taps on the
<dd>
Sets or gets the description displayed in the info window that appears when the user taps on the
marker.
</dd>
marker.
</dd>
<dt
class=
"boolean"
id=
"Marker.Draggable"
>
Draggable
<i></i></dt>
<dt
class=
"boolean"
id=
"Marker.Draggable"
>
Draggable
<i></i></dt>
<dd>
The Draggable property is used to
set
whether or not the user can drag the marker by
<dd>
The Draggable property is used to
control
whether or not the user can drag the marker by
long-pressing and then dragging the marker to a new location.
</dd>
long-pressing and then dragging the marker to a new location.
</dd>
<dt
class=
"boolean"
id=
"Marker.EnableInfobox"
>
EnableInfobox
<i></i></dt>
<dt
class=
"boolean"
id=
"Marker.EnableInfobox"
>
EnableInfobox
<i></i></dt>
<dd>
Enables or disables the infobox window display when the user taps the marker.
</dd>
<dd>
Enables or disables the infobox window display when the user taps the marker.
</dd>
...
@@ -1002,13 +1003,13 @@
...
@@ -1002,13 +1003,13 @@
circle to the given point. Otherwise, the distance is computed from the closest point on the marker
circle to the given point. Otherwise, the distance is computed from the closest point on the marker
to the given point. If an error occurs, -1 will be returned.
</dd>
to the given point. If an error occurs, -1 will be returned.
</dd>
<dt
id=
"Marker.HideInfobox"
>
HideInfobox
</dt>
<dt
id=
"Marker.HideInfobox"
>
HideInfobox
</dt>
<dd>
Hides the circle's info box if it is visible. Otherwise,
this method has no effect
.
</dd>
<dd>
Hides the circle's info box if it is visible. Otherwise,
no action will be taken
.
</dd>
<dt
id=
"Marker.SetLocation"
>
SetLocation(number latitude, number longitude)
</dt>
<dt
id=
"Marker.SetLocation"
>
SetLocation(number latitude, number longitude)
</dt>
<dd>
Moves the center of the circle to the given latitude and longitude. This method is more efficient
<dd>
Moves the center of the circle to the given latitude and longitude. This method is more efficient
than setting latitude and longitude separately.
</dd>
than setting latitude and longitude separately.
</dd>
<dt
id=
"Marker.ShowInfobox"
>
ShowInfobox
</dt>
<dt
id=
"Marker.ShowInfobox"
>
ShowInfobox
</dt>
<dd>
Shows the info box for the circle if it is not visible. Otherwise,
this method has no
<dd>
Shows the info box for the circle if it is not visible. Otherwise,
no action will be taken. This
effect. This
method can be used to show the info box even if EnableInfobox is false.
</dd>
method can be used to show the info box even if EnableInfobox is false.
</dd>
</dl>
</dl>
<h2
id=
"Polygon"
>
Polygon
</h2>
<h2
id=
"Polygon"
>
Polygon
</h2>
...
@@ -1068,11 +1069,11 @@
...
@@ -1068,11 +1069,11 @@
<h3>
Methods
</h3>
<h3>
Methods
</h3>
<dl>
<dl>
<dt
id=
"Polygon.Centroid"
>
list Centroid
</dt>
<dt
id=
"Polygon.Centroid"
>
list Centroid
</dt>
<dd>
Returns the centroid of the pol
uh
on as a list of the form
<code>
(Latitude Longitude)
</code>
.
</dd>
<dd>
Returns the centroid of the pol
yg
on as a list of the form
<code>
(Latitude Longitude)
</code>
.
</dd>
<dt
id=
"Polygon.DistanceToFeature"
>
number DistanceToFeature(component mapFeature, boolean centroid)
</dt>
<dt
id=
"Polygon.DistanceToFeature"
>
number DistanceToFeature(component mapFeature, boolean centroid)
</dt>
<dd>
Computes the distance between the polygon and the given mapFeature. If centroids is true, the
<dd>
Computes the distance between the polygon and the given mapFeature. If centroids is true, the
computation is done between the centroids of the two features. Otherwise, the distance will be
computation is done between the centroids of the two features. Otherwise, the distance will be
computed between the two features based on the closest points. Further,
when
centroids is false,
computed between the two features based on the closest points. Further,
if
centroids is false,
this method will return 0 if the polygon intersects or contains the mapFeature. If an error occurs,
this method will return 0 if the polygon intersects or contains the mapFeature. If an error occurs,
this method will return -1.
</dd>
this method will return -1.
</dd>
<dt
id=
"Polygon.DistanceToPoint"
>
number DistanceToPoint(number latitude, number longtitude, boolean centroid)
</dt>
<dt
id=
"Polygon.DistanceToPoint"
>
number DistanceToPoint(number latitude, number longtitude, boolean centroid)
</dt>
...
@@ -1091,8 +1092,7 @@
...
@@ -1091,8 +1092,7 @@
<h2
id=
"Rectangle"
>
Rectangle
</h2>
<h2
id=
"Rectangle"
>
Rectangle
</h2>
<p>
Rectangles are polygons with fixed latitudes and longitudes for the north, south, east, and west
<p>
Rectangles are polygons with fixed latitudes and longitudes for the north, south, east, and west
boundaries of the polygon. Moving a vertex of the rectangle updates the appropriate edges
boundaries. Moving a vertex of the rectangle updates the appropriate edges accordingly.
</p>
accordingly.
</p>
<h3>
Properties
</h3>
<h3>
Properties
</h3>
<dl>
<dl>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment