---
title: "Implement Pushin on google Map"  
description: "Implement Pushin on google Map"  
author: "Anonymous User"  
published: 2016-01-11  
updated: 2016-01-11  
canonical: https://www.mindstick.com/forum/33853/implement-pushin-on-google-map  
category: "android"  
tags: ["android", "google api"]  
reading_time: 1 minute  

---

# Implement Pushin on google Map

I am implementing to show the particular [location](https://www.mindstick.com/blog/11636/relocating-business-or-office-to-another-location) on the [map](https://yourviews.mindstick.com/view/81351/nepal-parliament-s-approves-new-controversial-map-india-rejects-it-but) and on the same location i want to [put](https://answers.mindstick.com/qa/111890/can-you-explain-the-difference-between-put-and-post-http-methods) the pushpin notification. I have tried to sove this in my way using below [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) but it showing nullpointer [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling), [please suggest](https://answers.mindstick.com/qa/43506/please-suggest-the-bathing-date-at-kumbh) me the [right](https://www.mindstick.com/articles/12766/check-whether-you-are-doing-digital-transformation-right-or-not) solution to implement the markers

```
public class MapDemoActivity extends MapActivity {
 MapView mapView;
 MapController mc;
 GeoPoint p;
 class MapOverlay extends com.google.android.maps.Overlay
    {
        @Override
        public boolean draw(Canvas canvas, MapView mapView,
        boolean shadow, long when)
        {
            super.draw(canvas, mapView, shadow);

            //---translate the GeoPoint to screen pixels---
            Point screenPts = new Point();
            mapView.getProjection().toPixels(p, screenPts);

            //---add the marker---
            Bitmap bmp = BitmapFactory.decodeResource(
                getResources(), R.drawable.pushpin);
            canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
            return true;
        }
    }

 public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mapView = (MapView) findViewById(R.id.mapView);

        mapView.setBuiltInZoomControls(true);
        mc.animateTo(p);
        mc.setZoom(17);

        //---Add a location marker---
        MapOverlay mapOverlay = new MapOverlay();
        List<Overlay> listOfOverlays = mapView.getOverlays();
        listOfOverlays.clear();
        listOfOverlays.add(mapOverlay);

        mapView.invalidate();

    }
@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}
```

## Replies

### Reply by Anonymous User

Refer this link :[https://github.com/commonsguy/cw-advandroid/tree/master/Maps/NooYawkTouch/](https://github.com/commonsguy/cw-advandroid/tree/master/Maps/NooYawkTouch/)\


---

Original Source: https://www.mindstick.com/forum/33853/implement-pushin-on-google-map

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
