user1651105
user1651105

Reputation: 1807

How to add markers to SKMaps?

I am developing an android application with SKMaps. I managed to run load the map, add the route and start/stop navigation. However i can't seem to find a way to add markers.

SKMapSurfaceView has methods .AddCircle or .AddCustomPOI.

I tried the circle and it drew nothing.

SKCircle c = new SKCircle();
c.CircleCenter = new SKCoordinate(Longitude, Latitude);
c.Radius = 50;
c.OutlineSize = 1;
c.SetColor(new float[] { 0.0F, 0.0F, 0.0F });
c.SetOutlineColor(new float[] { 255.0F, 0.0F, 0.0F });
surface.AddCircle(c);

Then i tried the custom POI:

SKMapCustomPOI poi = new SKMapCustomPOI();
poi.Category = SKCategories.SKPOICategory.SkpoiCategoryBuilding;
poi.Location = new SKCoordinate(Longitude,Latitude);
poi.UniqueID = 195;
surface.AddCustomPOI(poi);

This resulted in an application crash. It actually crashes with no exception being caught by Visual Studio.

How can i add a marker to the map? Remove it when no longer needed?

The online documentation is pretty much nonexistent. The only thing i have found which is about the markers is 'How to rotate the marker'.

The official documentation has "setCurrentPositionIconFromView" which is not what i actually need.

Upvotes: 2

Views: 213

Answers (1)

unlimited101
unlimited101

Reputation: 3803

You maybe mean annotations? How about this?

https://github.com/sjchristi/skobbler-mono-bindings#annotations

Upvotes: 2

Related Questions