Select to view content in your preferred language

How can i add marker like google map and popWindow

1033
1
09-24-2019 04:04 AM
NishidhKhanapara
Emerging Contributor

arcgis team ,
i have go through this demo it is good but i have some query how can i add marker like google map and it's popwindow. i have seen in example here is point but other query is how can i get point here is given all static point i want to draw path which user selected location from a to b.
is there any option for that ?

0 Kudos
1 Reply
MarkBaird
Esri Regular Contributor

You can almost certainly do all the things you mention above.  If you are familiar with google maps then you might want to take a quick look at this article:

Migrate from Google Maps to ArcGIS Runtime—ArcGIS Runtime SDK for Android | ArcGIS for Developers 

I can see from the post you originally posted on our samples reprository you are interested in putting a marker on a map at a given Lat / Long location.  If you have a very basic app up and running from one of our samples then the following code shows how you can put a very simple dot on a map:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mMapView = findViewById(R.id.mapView);
    mMap = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
    mMapView.setMap(mMap);

    // create a graphics overlay and add to map view
    GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
    mMapView.getGraphicsOverlays().add(graphicsOverlay);

    // define a symbol style for your "dot".  There are lots more styles available but this is a very simple red dot
    SimpleMarkerSymbol sms = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xFFFF0000, 20);

    // create point geometry of your dot in the WGS84 spatial reference
    Point location = new Point(-117.195800, 34.056295, SpatialReferences.getWgs84());

    // create a graphic from  your point and style
    Graphic graphic = new Graphic(location, sms);

    // add the graphic to the graphics overlay so you see it on your map view
    graphicsOverlay.getGraphics().add(graphic);
}

Lots more to read about graphics overlays here:  

Add graphics and text to graphics overlays—ArcGIS Runtime SDK for Android | ArcGIS for Developers 

I'm not sure about your other request, but if you can explain to me exactly what you are trying to achieve I can point you at the correct sample code or documentation.

0 Kudos