Efficient Map Overlays in Android Google Map

后端 未结 5 1315
北恋
北恋 2020-12-04 07:50

I want to do the following and am kind of stuck on these for a few days:

  1. I was trying to draw polylines (I have encoded polylines, but have

5条回答
  •  -上瘾入骨i
    2020-12-04 08:26

    Multiple number of drawable objects can be added to a single Overlay which can then be added to the map. Hence, drawing x number of overlay's for x number of objects wouldnt be necessary unless the objects are of different types. Code snippet.. .. Here, CustomPinPoint is my class which extends ItemizedOverlay

    CustomPinPoint customPinPoint = new CustomPinPoint(drawable, Main.this);
    
    OverlayItem tempOverLayItem = new OverlayItem(
        touchedPoint, "PinPoint", "PintPoint 2"); //Point One
    customPinPoint.insertPinPoint(tempOverLayItem);
    tempOverLayItem = new OverlayItem(new GeoPoint(
            (int)(-27.34498 * 1E6), (int)(153.00724 * 1E6)), "PinPoint",
        "PintPoint 2"); //Point Two
    customPinPoint.insertPinPoint(tempOverLayItem);
    overlayList.add(customPinPoint); //Overlay added only once
    

提交回复
热议问题