Not necessary for the final one ggplot(p)(maybe you selected a bug at your end) and I would use geom_path:
p <- ggmap(Bangalore)
p <- p + geom_point(data=d, aes(x=lon, y=lat),color="red",size=3)
p + geom_path(data=d, aes(x=lon, y=lat), color="black", size=1)
p + geom_line(data=d, aes(x=lon, y=lat), color="black", size=1)

source
share