I would like to make markers that doesn\'t move when the map rotates, exactly like the polylines. My goal is to give the marker a single orientation that never changes even when
The MapMarker object is what you are looking for? It is anchored to the position you give it and it will always be drawn in screen 2d space regardless of the tilt and rotate you apply to the map.
Hope this helps.
You can draw a simple rectangle with both front and back facing sides textured as follows:
// Two triangles
FloatBuffer buff = FloatBuffer.allocate(12);
buff.put(0- delta);
buff.put(0- delta);
buff.put(1.f);
buff.put(0 + delta);
buff.put(0 - delta);
buff.put(1.f);
buff.put(0 - delta);
buff.put(0 + delta);
buff.put(1.f);
buff.put(0 + delta);
buff.put(0 + delta);
buff.put(1.f);
// Two triangles to generate the rectangle. Both front and back face
IntBuffer vertIndicieBuffer = IntBuffer.allocate(12);
vertIndicieBuffer.put(0);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(3);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(0);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(2);
vertIndicieBuffer.put(1);
vertIndicieBuffer.put(3);
vertIndicieBuffer.put(2);
// Texture coordinates
FloatBuffer textCoordBuffer = FloatBuffer.allocate(8);
textCoordBuffer.put(0.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(0.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(1.f);
textCoordBuffer.put(1.f);
// The LocalMesh itself.
LocalMesh mesh = new LocalMesh();
mesh.setVertices(buff);
mesh.setVertexIndices(vertIndicieBuffer);
mesh.setTextureCoordinates(textCoordBuffer);
MapLocalModel model = new MapLocalModel();
model.setMesh(mesh);
model.setDynamicScalingEnabled(true);
model.setAnchor(new GeoCoordinate(LATITUDE, LONGITUDE, 0.0));
Attach an image to it for texture, and use MapRenderLisener#onPredraw() to change the pitch and yaw of the local model object to follow the camera.