Ubidots Community

Help Needed for Setting up Gps Markers!

We are developing a Real Time Air Pollution Monitoring System in which data are collected from a set of air pollution sensors using NodeMCU and these data are mapped into each locations(gps sensor) using Ubidots map widget. But the problem is that when a new location with the data is added, the previous location data gets erased. But we need to display data in every locations. Kindly help us in finding a solution!

  latitude = gps.location.lat();
  longitude = gps.location.lng();
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  dtostrf(20, 4, 2, str_val_1);
  dtostrf(latitude, 4, 7, str_lat);
  dtostrf(longitude, 4, 7, str_lng);

  char context[25];
  sprintf(context, "\"lat\":%s,\"lng\":%s", str_lat, str_lng);
  client.add("gps", 2, context);
  client.add("Temp", t, context);
  client.add("Hum", h, context);
  client.ubidotsPublish("Mapping");
  client.add("Temperature", t);
  client.add("Humidity", h);
  client.ubidotsPublish("DHT");


  client.loop();

  delay(5000);

Good day @ashwin123,

Thank you for sharing your question with the community.

Using the map widget you can display a trace of the device locations. Please refer to the following article to learn how.

Feel free to let us know if you have further questions.

Best,
–Isabel