-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Are Android Sprites actually sprites? #3304
Comments
@tmcw Current implementation:We are using the following Builder pattern to create a marker. mMapView.addMarker(new MarkerOptions()
.title("Intersection")
.snippet("H St NW with 15th St NW")
.icon(SpriteFactory.getInstance(this).fromAsset("london-underground-24.png"))
.position(new LatLng(38.9002073, -77.03364419))); Google Maps implementation:Google uses mMap.addMarker(new MarkerOptions()
.position(MELBOURNE)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); Suggestion:I see 2 possibilities to resolve confusion around this topic:
|
I think we have some legacy issues here. Sprites used to be supported as Maki icons before, but now that's been removed and only custom image assets are supported (outside the default icon). We likely could move to something called |
For the styles API and general GL user documentation, we've settled on "sprite" = a set of individual images collected into one object for optimal network/graphics performance, and "icon" = an constituent element of a sprite. So +1 for |
Going to change implementation to |
…the sprite names to icon for convention
@tobrun Is there a PR for this? I'm just trying to make sure that we have everything documented for release. |
I'm seeing an opportunity here: Land the MapboxMap class refactor #3145:
End result would be Google Maps drop-in replacement: public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(MapboxMap map) {
// Add a marker in Sydney, Australia, and move the camera.
LatLng sydney = new LatLng(-34, 151);
map.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
map.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
} |
Sounds good @tobrun. Please ticket it out so that work can be done on it after |
Just consulted with my college books. Checks out. |
It looks like the Sprite concept in android represents a _single_marker, which is a very different thing than the packed spritesheets of GL Native itself.
The text was updated successfully, but these errors were encountered: