Blynk map not showing proper location

I don’t know what I’m doing wrong with this simple code on my WeMos Mini D1. I’m trying to integrate a GPS and have reduced the code to the following test. The display is updating correctly for the changing latitude but the location marker remains fixed in Antartica.

Is there something wrong with my code, or is it something on the Blynk app side? I’m using IOS.

#include <BlynkSimpleEsp8266.h>
#include "secret.h"

WidgetMap myMap(V0); // V0 for virtual pin of Map Widget

int counter = 0;
BlynkTimer timer;

void setup() {
  Blynk.begin(Blynk_API_Key,WiFi_SSID, WiFi_PASSWORD);
  timer.setInterval(5000L, sendToBlynk);
} // setup

void sendToBlynk(){
float lat = 51.507351;
float lon = -0.127758;
int index = 1;
  myMap.clear();
  myMap.location(index,(lat+counter/10000.0),lon,String(lat+counter/10000.0,6));
  Blynk.virtualWrite(V1, String(lat+counter/10000.0, 6));   
  Blynk.virtualWrite(V2, String(lon, 6)); 
    counter++; 
} // sendToBlynk

void loop() {
  Blynk.run();
  timer.run();
} // loop

Not ssure what is the issue, but noticed that you don’t need to do myMap.clear() each time, since you just updating same annotation (same index).

What does map show if you explicitly send:

myMap.location(0, 51.507351, -0.127758, "my place");

I made the changes you suggested with the same result. I’ve been fighting this all day and did the clear and dynamic updates to try to debug the problem.

I suspect this added calculation to the LAT is introducing the error as otherwise your base coordinates place the pointer in the middle of London.

Thanks for the suggestion. I took them out as Eugene also suggested, which I also appreciate, and there is no change. I only put them in so I could verify the map call was updating correctly. I have tried dozens of calls with different data and with some data the marker was placed in the Atlantic off of Africa but the placement did not seem to have any bearing on the actual data. I tried multiple indexes to display multiple markers and when I got one to move off the antarctic a small change would make it disappear (or maybe hidden under another marker in the antarctic).

I tried updating all my Arduino libraries. I tried with a vanilla WeMos with no other connections. Nothing changes.

I have no idea what to try next.

OK, I took your code and ran it… It started in london and slowly moved the marker up the map to the North… seemed to work OK for me.

Except, that once the marker was off the map it stayed gone… the map (in Android at least) doesn’t auto center to the last marker location.

Thanks for trying it. I had to zoom out as far as possible and drag the map around to even find the marker in the antarctic. I am using IOS and wonder if there is some setting in that app that is causing the problem. I don’t see what it could be, though.

The only settings the Map has is show location (of your phone)… and unless them militant penguins from Madagascar have setup a WiFi hotspot for you, I don’t think your phone is there :stuck_out_tongue:

If I enable the phone location it shows correctly for my phone but not the WeMos data. I went into the phone settings for Blynk and enabled everyting, even to let Siri use it. :sunglasses:

@mcgeehd just ran your code and it shows map correctly on iOS.
Check if you have Map widget set correctly (V0)

@Eugene Does this (Map auto centering) work as expected on iOS?

Yes.
Note that map auto following pins turns off if you manually zoom map, and turns on if you tap on “magnifier” icon at top right.

Thanks for looking into this. I was using the 0.5.3 version of the Arduino Blynk library. I reverted to version 0.5.2 and it is displaying correctly now.

OK… my experience on the Android version is that it never follows any new or adjusted pins until I tap on the upper right icon, and then it remains in that position even if the marker (in this OPs code) moves off screen. I am not manually adjusting any zoom.