mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
827 stars 253 forks source link

Using WideVectorInfo on Android platform, I got an incorrect result. #1566

Open lzx1 opened 1 year ago

lzx1 commented 1 year ago

I want to draw a line like this:

QQ截图20221109154611 I used WideVectorInfo: val sourceImage = BitmapFactory.decodeResource(activity.resources, R.drawable.linesource) val texSet = TextureSettings().apply { wrapU = true wrapV = true } baseController.addTexture(sourceImage, texSet, ThreadMode.ThreadCurrent) val wideVecInfo = WideVectorInfo().also { it.color = color it.lineWidth = width it.drawPriority = drawPriority if (tex != null) { it.setTexture(tex) } it.edgeFalloff = edge } try { val stream = activity.assets.open("wide_vecs/$name") VectorObject.createFromGeoJSON(stream.source().buffer().readUtf8()) ?.subdivideToGlobeGreatCircle(0.0001)?.let { return listOfNotNull( baseController.addWideVector(it, wideVecInfo, ThreadMode.ThreadCurrent)) } } catch (e: Exception) { Log.e(javaClass.simpleName, "Failed", e) }

the linesource drawable resources:

airspace1

But what I got was this: Screenshot_20221109_154916_com mousebirdconsulting autotester

What should I do?

sjg-wdw commented 1 year ago

I'd suggest creating a short example to get the texture application right and then expand outward to the bigger example.