How to add markers on Google Maps?

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

How to add markers on Google Maps?

Postby JetPro » Tue Jun 26, 2012 2:41 pm

Code: Select all
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //Displaying the map
        mapView = (MapView) findViewById(R.id.googleMap);
        LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoomControls); 
        View zoomView = mapView.getZoomControls();
       
        //Setting the zoom controls
        zoomLayout.addView(zoomView,
            new LinearLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT));
        mapView.displayZoomControls(true);
        mapView.setStreetView(true);
       
        //Setting the default zoom view
        mc = mapView.getController();
        String coordinates[] = {"14.069315", "121.323738"};
        double lat = Double.parseDouble(coordinates[0]);
        double lng = Double.parseDouble(coordinates[1]);

        p = new GeoPoint(
            (int) (lat * 1E6),
            (int) (lng * 1E6));

        mc.animateTo(p);
        mc.setZoom(15);
        mapView.invalidate();



How can I add markers using coordinates (Longitude and Latitude)?
JetPro
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jun 26, 2012 2:31 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 2 guests