-
I see examples like the HexagonRenderer however all example I find simply draw on the center of the map. A simple question would be, how to modify HexagonRenderer example file to render the hexagons centered at a give lat/lon (not middle of map) and size them a give size in meters/feet on the map surface to make sure it scales. For simplicity, what would need to be done to draw the HexagonRenderer and N8 00.000 W5 00.000 with a size of 100m per hexagon. Drawing a single Hexagon centered at that point is good enough as an example. It can't be too hard but not finding any good starting point. Thanks everyone! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
You can see an example with overlays, like VectorLayerActivity. It can be adapted to overlay various geometries with |
Beta Was this translation helpful? Give feedback.
-
The following code seems to work: Style style = Style.builder()
.fillAlpha(0.3f)
.fillColor(Color.BLUE)
.strokeColor(Color.BLUE)
.strokeWidth(2)
.build();
vectorLayer.add(new PolygonDrawable(style,
new GeoPoint(-20d, -20d),
new GeoPoint(20d, -20d),
new GeoPoint(20d, 20d),
new GeoPoint(-20d, 20d))); |
Beta Was this translation helpful? Give feedback.
-
The general advice in such cases is usually: If the upstream repository works correctly, while you use old library and the custom code does not work, |
Beta Was this translation helpful? Give feedback.
-
AbstractVectorLayer.java /** running on worker thread */
@Override
public boolean doWork(Task t) {
Viewport v = mMap.viewport();
BoundingBox bbox;
synchronized (v) {
bbox = v.getBBox();
v.getMapPosition(t.position);
}
processFeatures(t, bbox);
t.buckets.prepare(); // missing for me, now present in current version....
mMap.render();
return true;
}
} Above my fix that is needed for MY version. Repo code now has that line added. My copy was missing the prepare() statement. Thanks everyone, Can be closed now. |
Beta Was this translation helpful? Give feedback.
-
The fork has always had this line from the beginning. |
Beta Was this translation helpful? Give feedback.
The following code seems to work: