You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
The JNI part of things is straightforward, and I have verified that addPointAnnotation in the C++ Map is indeed being called. However, my single point annotation is not successfully rendering on the map.
I'm studying how annotations work in the core library in this MapboxGL Native Annotations Walkthrough. @incanus, one conceptual question I have deals with that final conversion to the vector space of a tile for a given point:
We just computed x, which is a 32 bit unsigned int. We then do pp.x * z2 - x which just subtracts the truncated int from the complete double. How does that then relate to determine the correct coordinate in the vector space of the given tile?
I was able to follow the code through setting up the annotation vector tiles as well as telling the map what to update.
Where do I look to learn about how that actual sprite is rendered on the map? My guess is that the actual problem here is that somehow the sprite itself is not being rendered in Android. I don't think the problem at hand is involved with the cutting of the annotation vector tiles.
Note, stepping through all of the function calls mentioned in the point annotation walkthrough seem to execute fine when poking around my android device in gdb. My thought is that the annotation is actually added to the map just fine. Maybe the marker sprite is just not being rendered?
I am currently working on the annotation proof of concept of adding a single marker to the map via the Android MapView. I have my own fork/branch of MapboxGL where I have simply added a basic addAnnotation(LatLng latLng) as well as a simple MenuItem to toggle on and off a marker.
Extending the Java API seems straightforward, however, there is a problem with actually rendering this marker on the map. Calling addPointAnnotation on the native map view appears to be behaving normally. Stepping through (in gdb) all of the calls of auto result = data->annotationManager.addPointAnnotations(points, properties, getMaxZoom()); appears to be behaving normally when comparing to what happens in the XCode debugger on iOS.
My suspicion is that there is a problem loading that default_marker glyph that we have in iOS for markers. It looks like this marker comes from somewhere other than the standard glyps in MapboxGL, specifically for annotations. Could someone help point out:
Where do glyphs get loaded, in specific, default_marker, and how is that loaded in the texture buffer for GL to render?
I will continue to trace through what happens in the MapContext::updateAnnotationTiles call on the map thread, however, I was hoping to get a bit of a tour of the architecture and code with this specific part of the rendering pipeline. In particular, how do marker annotations integrate?
@ljbade Could you comment a bit on why you believe this is "Done"? What changed since the 31-Aug-2015 comment? I see that #1726 has been ticketed out separately, but it's unclear what else was finished. Thanks!
Activity
hallahan commentedon Jun 29, 2015
I forked the repo and am working on a branch that attempts to add a point annotation to the map via a call to the native Map::addPointAnnotation.
hallahan@ef31fc5
The JNI part of things is straightforward, and I have verified that
addPointAnnotationin the C++ Map is indeed being called. However, my single point annotation is not successfully rendering on the map.I'm studying how annotations work in the core library in this MapboxGL Native Annotations Walkthrough. @incanus, one conceptual question I have deals with that final conversion to the vector space of a tile for a given point:
We just computed
x, which is a 32 bit unsigned int. We then dopp.x * z2 - xwhich just subtracts the truncated int from the complete double. How does that then relate to determine the correct coordinate in the vector space of the given tile?I was able to follow the code through setting up the annotation vector tiles as well as telling the map what to update.
Where do I look to learn about how that actual sprite is rendered on the map? My guess is that the actual problem here is that somehow the sprite itself is not being rendered in Android. I don't think the problem at hand is involved with the cutting of the annotation vector tiles.
hallahan commentedon Jul 1, 2015
Note, stepping through all of the function calls mentioned in the point annotation walkthrough seem to execute fine when poking around my android device in
gdb. My thought is that the annotation is actually added to the map just fine. Maybe the marker sprite is just not being rendered?hallahan commentedon Jul 13, 2015
I am currently working on the annotation proof of concept of adding a single marker to the map via the Android MapView. I have my own fork/branch of MapboxGL where I have simply added a basic
addAnnotation(LatLng latLng)as well as a simple MenuItem to toggle on and off a marker.We then call the native
addPointAnnotationvia a JNI call.Extending the Java API seems straightforward, however, there is a problem with actually rendering this marker on the map. Calling
addPointAnnotationon the native map view appears to be behaving normally. Stepping through (in gdb) all of the calls ofauto result = data->annotationManager.addPointAnnotations(points, properties, getMaxZoom());appears to be behaving normally when comparing to what happens in the XCode debugger on iOS.My suspicion is that there is a problem loading that
default_markerglyph that we have in iOS for markers. It looks like this marker comes from somewhere other than the standard glyps in MapboxGL, specifically for annotations. Could someone help point out:Where do glyphs get loaded, in specific,
default_marker, and how is that loaded in the texture buffer for GL to render?I will continue to trace through what happens in the
MapContext::updateAnnotationTilescall on the map thread, however, I was hoping to get a bit of a tour of the architecture and code with this specific part of the rendering pipeline. In particular, how do marker annotations integrate?cc @kkaefer @tmpsantos
tmpsantos commentedon Jul 13, 2015
Try using
std::string("default_marker").hallahan commentedon Jul 13, 2015
Thank you @tmpsantos. We now have our first marker annotation on MapboxGL Android!
Specifically naming the sprite in JNI adds a marker to the map mapbox…
Able to remove an annotation from the map mapbox#1716
Fleshed out the shell of the Google Maps API mapbox#1716
parsed coordinates from geojson, ready to add polyline via JNI mapbox…
working on pollens mapbox#1716
constructs polyline object, ready to rock JNI mapbox#1716
JNI is compiling with the polyline object mapbox#1716
32 remaining items
ljbade commentedon Oct 24, 2015
Done!
bleege commentedon Oct 26, 2015
@ljbade Could you comment a bit on why you believe this is "Done"? What changed since the 31-Aug-2015 comment? I see that #1726 has been ticketed out separately, but it's unclear what else was finished. Thanks!
ljbade commentedon Oct 26, 2015
@bleege Well we implemented all features of iOS SDK annotations since #2744 and #2726
Finally I have removed all annotation properties that are not supported in Core GL.
So the original aim of this ticket to reach parity with iOS has been achieved.
drawing geojson line mapbox#1716
creating an annotation segment from a LatLng jlist encapsulated in fu…
Java Annotation API cleaner mapbox#1716
toggle removes all annotations. ready for polygon JNI mapbox#1716
polygon JNI mapbox#1716
yay, polygon! mapbox#1716
showing polygon, line, and markers together mapbox#1716
added ability to specify sprite in marker mapbox#1716
Merge remote-tracking branch 'mapbox/master' into android-annotations m…
commenting mapbox#1716
marker equals method mapbox#1716