Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

how to update marker location in mapviews
Started by kakula Dec 09 2018 05:07 PM

No replies to this topic
mapview marker update
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

kakula

[GLOBAL: userInfoPane.html]
kakula
  • Enthusiast

  • 82 posts
  • Corona SDK

Hi

 

i have a case where i'm loading a mapview and adding markers

 

i also want my position to update as i move

 

i did it by setting a timer function to remove marker and add it again, also setting the center again with myMap:setCenter

 

mt problem is that the image icon i'm using for gps location is doing some annoying transition falling from above on the map .... first time it shows it looks cool, but when you refresh each 5 or 10 seconds it looks weird and keeps falling ... is there a way to make it just move . ... similar to Uber Taxi Cabs for example ... it doesn't have to be smooth transition but at least no falling

 

local function refreshMyLoaction()
    if result1~=nil then
        local currentLocation = myMap:getUserLocation()
        myMap:removeMarker( result1 )
        local opt1={
                title = "You'r here",
                subtitle ="",
                imageFile =  "images/gps3.png",
              }
          result1, errorMessage1 = myMap:addMarker( currentLocation.latitude, currentLocation.longitude,opt1 )
          myMap:setCenter( currentLocation.latitude, currentLocation.longitude )
    end
    timer.performWithDelay(10000,refreshMyLoaction)    
end
refreshMyLoaction()

 




[topic_controls]
[/topic_controls]