Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Use Maki Icon In TestApp #2624

Closed
bleege opened this issue Oct 14, 2015 · 4 comments
Closed

Use Maki Icon In TestApp #2624

bleege opened this issue Oct 14, 2015 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@bleege
Copy link
Contributor

bleege commented Oct 14, 2015

The project claims that "Developers can still use the Maki sprites from the styles just like Sirius does.", however Sirius is only using the default_marker sprite. In order for this claim to be true, Maki icons should be loadable. Let's add a test / example of this in the TestApp.

/cc @ljbade @tobrun

@bleege bleege added the Android Mapbox Maps SDK for Android label Oct 14, 2015
@bleege bleege added this to the android-v2.1.0 milestone Oct 14, 2015
@tobrun
Copy link
Member

tobrun commented Oct 15, 2015

@bleege
So far I was able to identify the code example in Sirius:

Marker marker = mapView.addMarker(new MarkerOptions()
                    .position(point)
                    .title("Dropped Pin")
                    .snippet("Tap for x")
                    .sprite("default_marker"));

For different styles this will give me different icons, which makes me think that these icons aren't packaged with the aar but are fetched on the fly. I was able to identify a default_marker entry in emerald.json.

I tried replacing "default_marker" with "camera", but this gives me "Can't find sprite named 'camera'".
in sprite_store.cpp.

I also looked at raster SDK and their you have Icon and MapBoxUtils class.

Could you give me a bit more information how a maki icon should be resolved?

@bleege
Copy link
Contributor Author

bleege commented Oct 15, 2015

@tobrun Yep, I went through the same fun yesterday afternoon and came to the same conclusion. This turned out to be a communications / expectations issue. What this means for now is:

  1. Only Style Specific Sprites are supported for android-v2.1.0
    1. Ex: Only Sprites from emerald.json are available for rendering when using the Emerald Style.
  2. Maki support will be an example of custom raster image support that is blocked in setSprite does not handle scales <1.0x or >2.0x #2506.
  3. Move this ticket / addition of testing to android-v2.2.0

@bleege bleege modified the milestones: android-v2.2.0, android-v2.1.0 Oct 15, 2015
@ljbade
Copy link
Contributor

ljbade commented Oct 24, 2015

@bleege In the "Toggle point annotations" action I loaded the Maki dog icon. To do this I downloaded the PNG from the Maki page then added it to the app and loaded with fromBitmap.

It is a bit blurry as Maki only provide 1x and 2x. We could render more from the SVG using the upcoming VectorDrawable (#2736). Or we could use the SDF files and expose the Core GL support for this.

@tobrun Had suggested perhaps we could automate the addition of Maki more. Perhaps providing a function that goes off and loads a Maki icon from a string.

@bleege Is manually adding Maki PNGs enough or do we need to go further.

@bleege
Copy link
Contributor Author

bleege commented Oct 26, 2015

@ljbade No further action is needed here. This ticket was to clarify the original statement of "Developers can still use the Maki sprites from the styles just like Sirius does." Now that this is better understood to mean Style Specific Sprites and Add Support For Marker Bitmaps has been completed we should be good.

@bleege bleege closed this as completed Oct 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants