Маркер сюжета Android Java на карте Google с точкой геометрииJAVA

Программисты JAVA общаются здесь
Anonymous
Маркер сюжета Android Java на карте Google с точкой геометрии

Сообщение Anonymous »

Как я буду застроить маркер на карте Google с моими точками геометрии? Вот выборка точек геометрии геометрии (642823.3317 937067.5592999998 0) .
Я добавил JTS -зависимости, которая является org.locationtech.jts . Вот мой код: < /p>

Код: Выделить всё

// get the POINT Z (642823.3317 937067.5592999998 0)
String geometryPoints = record.getGeometry();

// parse the points using JTS
WKTReader reader = new WKTReader();
Geometry geometry = reader.read(geometryPoints);

if (geometry instanceof Point) {
double lat = geometry.getCoordinate().y;
double lng = geometry.getCoordinate().x;

LatLng position = new LatLng(lat, lng);

mMap.addMarker(new MarkerOptions()
.position(position)
.title(record.getKilometerPostId())
.snippet(record.getXsp())
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
}
Я также зарегистрировал geometry.getCoordinate (). x и он печатает на моем logCat. Тем не менее, это не показывает на моей карте Google. В чем может проблема?
Спасибо за помощь!

Подробнее здесь: https://stackoverflow.com/questions/795 ... etry-point

Вернуться в «JAVA»