mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Bitmap: icon-size with Expression.match blurs the icon

Open hrach opened this issue 6 years ago • 6 comments

Currently, when using style image (a bitmap) with icon-size which contains Expression.match expression, it blurs the icon. Please note that using Expression.literal(1f) works ok, but when this literal is in a match, the icon is blurred.

Steps to reproduce

  1. Take bitmap and put it into the style
  2. The same bitmap draw using ImageView
  3. See the difference
mapStyle.addImage("m_eating", ContextCompat.getDrawable(context, R.drawable.marker_eating)!!.toBitmap(64, 64), false)

marker_test.setImageBitmap(ContextCompat.getDrawable(context, R.drawable.marker_eating)!!.toBitmap(64, 64))

// style setting
withProperties(
	PropertyFactory.iconSize(
		Expression.match(
			Expression.get("sizeLevel"),
			Expression.literal(MarkerSize.LARGE.ordinal),
			Expression.literal(1f),
			Expression.literal(MarkerSize.MEDIUM.ordinal),
			Expression.literal(1f),
			Expression.literal(1f)
		)
	)
)

Expected behavior

Both bitmaps seems same.

Actual behavior

ImageView on the left, SymbolLayer on the right.

image

Configuration

Android versions: Android Q Device models: Pixel 2 Mapbox SDK versions: implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.2"

hrach avatar Sep 02 '19 10:09 hrach

Seem it is not connected to switch but the fact the value is passed by Expression and not Expression.literal(). E.g. using PropertyFactory.iconSize(Expression.get("")) doesn't work either.

hrach avatar Sep 05 '19 08:09 hrach

@hrach We're currently using nearest neighbor texture lookups to achieve crisp icons. When the size property is set with an expression, we switch to linearly interpolated texture lookups because we can't anticipate all possible values. I've ticketed this in https://github.com/mapbox/mapbox-gl-js/issues/8730 with a possible solution.

kkaefer avatar Sep 05 '19 19:09 kkaefer

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] avatar Mar 03 '20 20:03 stale[bot]

@kkaefer will you reopen please?

hrach avatar Mar 24 '20 10:03 hrach

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] avatar Sep 20 '20 13:09 stale[bot]

will you reopen please?

hrach avatar Sep 20 '20 17:09 hrach