I think to plot the points over the map the approach you are using is good
to me. Is there any reason you don't want to use ggplot to overlay points ?

This simple code below does what you want to do:

library(ggmap)
library(ggplot2)

latitude <- c(41.23,40.9)
longitude <- c(19.81, 19.79)
dfnew <- data.frame(latitude,longitude)

 al1 = get_map(location = c(41.325997,19.822027), zoom = 10, maptype =
'roadmap')
 ggmap(al1) + geom_point(data=dfnew, aes(x=latitude, y=longitude),size=5)

I hope this helps.


On Fri, Apr 19, 2013 at 7:55 AM, Endri Raco <endri81@gmail.com> wrote:

> Hi Johannes,
> Can you advice me a better package or approach to print points with known
> coordinates over a Google map ??
> Thx
>
>
> On Fri, Apr 19, 2013 at 12:53 PM, Endri Raco <endri81@gmail.com> wrote:
>
> > Hi Johannes
> > I get
> >
> > > ggmap(al1) + geom_point(data=points, aes(x=lat, y=lon,colour = type))
> > Warning message:Removed 7 rows containing missing values (geom_point).
> >
> > and the printed screen attached.
> >
> > Not clear at all pff :(
> >
> > Thx
> >
> >
> >
> >
> > On Fri, Apr 19, 2013 at 12:51 PM, Johannes Signer <j.m.signer@gmail.com
> >wrote:
> >
> >> It is plotted, there are just no roads in maptype='roadmap'. Try
> >>
> >> al1 = get_map(location = c(41.325997,19.822027), zoom = 15, maptype =
> >> 'satellite')
> >> ggmap(al1) + geom_point(data=points, aes(x=lat, y=lon,colour = type))
> >>
> >> HTH,
> >>
> >> Johannes
> >>
> >>
> >> On Fri, Apr 19, 2013 at 12:31 PM, Endri Raco <endri81@gmail.com> wrote:
> >>
> >>> Hi group.
> >>> I have coordinates as in file attached.
> >>> Trying to print this as points with different colors I follow the
> >>> commands:
> >>>
> >>>
> >>> > al1 = get_map(location = c(41.325997,19.822027), zoom = 10, maptype
> = 'roadmap')> ggmap(al1) + geom_point(data=points, aes(x=lat, y=lon5,colour
> = type))
> >>>
> >>> The problem is that with zoom = 10 I get very vague idea of points but
> if I try to zoom more than 15 nothing is plotted.
> >>>
> >>> Can you please advice any approach or R package to get out of this
> situation?
> >>>
> >>> Thx
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> R-sig-Geo mailing list
> >>> R-sig-Geo@r-project.org
> >>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>>
> >>>
> >>
> >>
> >> --
> >>
> >> ## ## Contact:
> >> ## Johannes Signer, MSc
> >> ## PhD-Candidate -- Wildlife Management
> >> ## Dept. of Forest Zoology & Forest Conservation
> >> ## University of Goettingen
> >> ## Buesgenweg 3 (room 85)
> >> ## 37077 Goettingen, Germany
> >> ## e: jmsigner@gmail.com
> >> ## p: +49 (0)551 39 3583
> >> ## m: +49 (0)176 61 962856
> >> ## skype: j.m.signer
> >> ## ##
> >>
> >
> >
> >
> > --
> > MSc. Endri Raço
> > _________________________________________________
> > Polytechnic University of Tirana
> > Faculty of Mathematical Engineering and Physics Engineering
> > Department of Mathematical Engineering
> > Address:  Sheshi Nene Tereza, Nr. 4, Tirana - ALBANIA
> > Mobile: ++ 355 682061988
> >
>
>
>
> --
> MSc. Endri Raço
> _________________________________________________
> Polytechnic University of Tirana
> Faculty of Mathematical Engineering and Physics Engineering
> Department of Mathematical Engineering
> Address:  Sheshi Nene Tereza, Nr. 4, Tirana - ALBANIA
> Mobile: ++ 355 682061988
>
>         [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

	[[alternative HTML version deleted]]

