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
1cac703d
Commit
1cac703d
authored
Nov 04, 2019
by
Evan W. Patton
Committed by
Susan Rati Lane
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix empty point, holepoints after polygon drag (#1898)
Change-Id: Ic56b10d6ca1df949a2bbf342b4bc7d3d473a6342
parent
fca2c244
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
appinventor/components/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
...omponents/runtime/util/NativeOpenStreetMapController.java
+19
-4
No files found.
appinventor/components/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
View file @
1cac703d
...
@@ -694,10 +694,8 @@ class NativeOpenStreetMapController implements MapController, MapListener {
...
@@ -694,10 +694,8 @@ class NativeOpenStreetMapController implements MapController, MapListener {
}
}
((
MapRectangle
)
component
).
updateBounds
(
north
,
west
,
south
,
east
);
((
MapRectangle
)
component
).
updateBounds
(
north
,
west
,
south
,
east
);
}
else
{
}
else
{
((
MapPolygon
)
component
).
updatePoints
(
Collections
.
singletonList
(
polygon
.
getPoints
()));
((
MapPolygon
)
component
).
updatePoints
(((
MultiPolygon
)
polygon
).
getMultiPoints
());
List
<
List
<
GeoPoint
>>
holes
=
new
ArrayList
<
List
<
GeoPoint
>>();
((
MapPolygon
)
component
).
updateHolePoints
(((
MultiPolygon
)
polygon
).
getMultiHoles
());
holes
.
addAll
(
polygon
.
getHoles
());
((
MapPolygon
)
component
).
updateHolePoints
(
Collections
.
singletonList
(
holes
));
}
}
for
(
MapEventListener
listener
:
eventListeners
)
{
for
(
MapEventListener
listener
:
eventListeners
)
{
listener
.
onFeatureStopDrag
(
component
);
listener
.
onFeatureStopDrag
(
component
);
...
@@ -1343,6 +1341,14 @@ class NativeOpenStreetMapController implements MapController, MapListener {
...
@@ -1343,6 +1341,14 @@ class NativeOpenStreetMapController implements MapController, MapListener {
}
}
}
}
public
List
<
List
<
GeoPoint
>>
getMultiPoints
()
{
List
<
List
<
GeoPoint
>>
result
=
new
ArrayList
<>();
for
(
Polygon
p
:
children
)
{
result
.
add
(
p
.
getPoints
());
}
return
result
;
}
public
void
setMultiPoints
(
List
<
List
<
GeoPoint
>>
points
)
{
public
void
setMultiPoints
(
List
<
List
<
GeoPoint
>>
points
)
{
Iterator
<
Polygon
>
polygonIterator
=
children
.
iterator
();
Iterator
<
Polygon
>
polygonIterator
=
children
.
iterator
();
Iterator
<
List
<
GeoPoint
>>
pointIterator
=
points
.
iterator
();
Iterator
<
List
<
GeoPoint
>>
pointIterator
=
points
.
iterator
();
...
@@ -1367,6 +1373,15 @@ class NativeOpenStreetMapController implements MapController, MapListener {
...
@@ -1367,6 +1373,15 @@ class NativeOpenStreetMapController implements MapController, MapListener {
}
}
}
}
@SuppressWarnings
(
"unchecked"
)
// upcasting nested ArrayList to List
public
List
<
List
<
List
<
GeoPoint
>>>
getMultiHoles
()
{
List
<
List
<
List
<
GeoPoint
>>>
result
=
new
ArrayList
<>();
for
(
Polygon
p
:
children
)
{
result
.
add
((
List
)
p
.
getHoles
());
}
return
result
;
}
public
void
setMultiHoles
(
List
<
List
<
List
<
GeoPoint
>>>
holes
)
{
public
void
setMultiHoles
(
List
<
List
<
List
<
GeoPoint
>>>
holes
)
{
if
(
holes
==
null
||
holes
.
isEmpty
())
{
if
(
holes
==
null
||
holes
.
isEmpty
())
{
for
(
Polygon
child
:
children
)
{
for
(
Polygon
child
:
children
)
{
...
...
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