Closed edurocks closed 4 years ago
@edurocks Could you provide a sample for us? You can use our map-objects example and modify it to show the problem.
Hi @Merlin1stHere . I am trying to do something like this. But the polyline never show the image. I don´t know if this image has to be on a specific format or not but i didn´t understand how to use it.
` List
mMapPolylineSecondRoute.setPatternStyle(MapPolyline.PatternStyle.DASH_PATTERN);
Image image = new Image();
try {
image.setImageResource(R.drawable.parking_active);
} catch (IOException e) {
e.printStackTrace();
}
mMapPolylineSecondRoute.setCustomPattern(image);
mMapPolylineSecondRoute.setDepthTestEnabled(true);
mMapPolylineSecondRoute.setExtrusionEnabled(true);
mMapPolylineSecondRoute.setPerspectiveEnabled(true);
mMapPolylineSecondRoute.setLineWidth(6);
mMapPolylineSecondRoute.setZIndex(1);
for (GeoCoordinate geoCoordinate : routeGeometry) {
mRoutePathCoordinates.add(new GeoCoordinate(geoCoordinate.getLatitude(), geoCoordinate.getLongitude()));
}
mPolylineSecondRoute.add(mRoutePathCoordinates);
mMapPolylineSecondRoute.setGeoPolyline(mPolylineSecondRoute);
if (mMap != null) mMap.addMapObject(mMapPolylineSecondRoute);`
@edurocks Could you provide a compilable sample for us? It would be better if I could see the image and the exact source code.
Solved. I used the properties of the polyline and I achieve my result. Now my problem is with the marker cluster. They are not appearing on the map.
ClusterLayer mClusterLayer = new ClusterLayer();
BasicClusterStyle mBasicClusterStyle = new BasicClusterStyle();
mBasicClusterStyle.setFillColor(ContextCompat.getColor(mMainActivity, R.color.routePath));
ClusterTheme clusterTheme = new ClusterTheme(); clusterTheme.setStyleForDensityRange(2, 300, mBasicClusterStyle); mClusterLayer.setTheme(clusterTheme); mMap.addClusterLayer(mClusterLayer); mClusterLayer.addMarkers(mTriggersMarker);
Good Afternoon, I have a problem. I am trying to draw a route on the map but with a dashed line. Whem I use the dah pattern from the map polyline it doesn´t give the effect that i want so i thought to use a image to do it and use the setCustomPattern to do it but when I provide a png image it doesn´t show the path with this image. I don´t know what is going on and if I am using it correctly. Thanks for the support.