Android Question Google Maps Marker Position

Discussion in 'Android Questions' started by tufanv, Mar 1, 2015.

  1. tufanv

    tufanv Expert Licensed User

    Hello,

    I want to show my cars current position on google map so with gps_locationchanged event I am clearing the gmap and adding the marker. But visually this is not good. With every position change marker clears then added again. How can i change the markers position with the cars new position. ( i dont want to clear and add again but change the marker position with the car)

    TY
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    Have you tried to put the marker to a map or list (in the MapFragment1_Ready sub) and then get it back in the gps_locationchanged event - like mymarker = list1.get(0) - and then set the new position instead of clearing the map and add it again

    cheers
    stefan
     
  3. tufanv

    tufanv Expert Licensed User

    I dont know how to change the position of marker without clearing and adding again
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You need to set the marker position property.
     
    tufanv likes this.
  5. eurojam

    eurojam Well-Known Member Licensed User

    Code:
    Dim LL As LatLng
    LL.Initialize(
    47.47.188'the new Position
    myMarker.Position(LL)
     
    tufanv likes this.
  6. tufanv

    tufanv Expert Licensed User

    Ok . I could initialize with
    mymarker=gmap.AddMarker2(location1.Latitude, location1.Longitude, "My Position", gmap.HUE_ORANGE)
     
  7. tufanv

    tufanv Expert Licensed User

    ı have another problem now . When maps get my location and sets the camera position according to it. maps are not fully loaded(it is blurry) until i move the position a bit. my code is as below:
    Code:
    mymarker=gmap.AddMarker3(location1.Latitude, location1.Longitude, "My Position",ikon)
        
    Dim LL As LatLng
    LL.Initialize(location1.Latitude,location1.Longitude)
    mymarker.Position = LL
        cp.Initialize(location1.Latitude,location1.Longitude,
    15)
        gmap.AnimateCamera(cp)
     
  8. eurojam

    eurojam Well-Known Member Licensed User

    can you post your project (File->Export as Zip)
     
  9. eurojam

    eurojam Well-Known Member Licensed User

    TY,
    your project seems to work. I have made some small changes, like using the OnMyLocationChangeListener Event from GoogleMapsExtra - so you don't need a GPS for the location change event which is helpful because I am developing not outside :D, I replaced your icon because adam.png yok...

    Cheers
    stefan
     

    Attached Files:

  10. tufanv

    tufanv Expert Licensed User

    Ty Stefan !

    Yes I figured it out that i had a problem with internet connection
     
  11. tufanv

    tufanv Expert Licensed User

    With my icon, Now there are 2 markers. One is the standard blue dot and other one is adam.png ( icon) how can i remove the blue one here :)
     
  12. eurojam

    eurojam Well-Known Member Licensed User

    put this to comment:
    Code:
    'mFragment.GetMap.MyLocationEnabled = True
    and uncomment the sub GPS_LocationChanged
     
    tufanv likes this.
  13. tufanv

    tufanv Expert Licensed User

    ok Thank you !
     
  14. eurojam

    eurojam Well-Known Member Licensed User

    bir şey değil
     
    tufanv likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice