Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps not working on chrome #60

Open
LuisFerMoreno opened this issue Dec 9, 2024 · 5 comments
Open

Maps not working on chrome #60

LuisFerMoreno opened this issue Dec 9, 2024 · 5 comments

Comments

@LuisFerMoreno
Copy link

In development mode the map runs correctly in every browser but in production it fail in chrome browser on computer site (I refeer you can load points or move the map, the only thing that works is the zoom in/out button ), in mobile works fine, could you tell me some tips to solve my problem?

@ichim
Copy link
Owner

ichim commented Dec 9, 2024

Can you provide more details? In Chrome, zooming in/out causes the PointStream collections to not have their normal position?

@LuisFerMoreno
Copy link
Author

Bounds.js:148 Uncaught TypeError: Cannot read properties of undefined (reading 'min')
at f.intersects (Bounds.js:148:21)
at e._empty (CircleMarker.js:95:50)
at e._updateCircle (SVG.js:176:17)
at e._updatePath (CircleMarker.js:91:18)
at e._update (CircleMarker.js:86:9)
at e._updatePaths (Renderer.js:118:21)
at e.fire (Events.js:195:9)
at e._update (SVG.js:88:8)
at e.fire (Events.js:195:9)
at e._onDragEnd (Map.Drag.js:195:8)
intersects @ Bounds.js:148
_empty @ CircleMarker.js:95
_updateCircle @ SVG.js:176
_updatePath @ CircleMarker.js:91
_update @ CircleMarker.js:86
_updatePaths @ Renderer.js:118
fire @ Events.js:195
_update @ SVG.js:88
fire @ Events.js:195
_onDragEnd @ Map.Drag.js:195
fire @ Events.js:195
finishDrag @ Draggable.js:209
_onUp @ Draggable.js:188
o @ DomEvent.js:108Understand this errorAI
Projection.SphericalMercator.js:24 Uncaught TypeError: Cannot read properties of null (reading 'lat')
at Object.project (Projection.SphericalMercator.js:24:43)
at Object.latLngToPoint (CRS.js:28:40)
at e.project (Map.js:982:27)
at e.latLngToLayerPoint (Map.js:1004:29)
at e._project (CircleMarker.js:72:27)
at e._onZoomEnd (Renderer.js:112:21)
at e.fire (Events.js:195:9)
at e._moveEnd (Map.js:1248:9)
at e._onZoomTransitionEnd (Map.js:1735:8)

This are the error that show up on chrome dev tools

@LuisFerMoreno
Copy link
Author

Can you provide more details? In Chrome, zooming in/out causes the PointStream collections to not have their normal position?

I have a method to visualize an area but in edge it work fine but in chrome the map freeze, this is my code

public async Task AddPolygonToMap()
{
Console.WriteLine("Se ejecuta AddPolygonToMap");

  if (_geoFence == null || !_geoFence.Any())
  {
      Console.WriteLine("_geoFence está vacío o es null.");
      return;
  }

  if (leafletMap == null)
  {
      Console.WriteLine("leafletMap no está inicializado.");
      return;
  }

 
  coordinates = _geoFence.Select(item => new double[] { item.Latitude, item.Longitude }).ToList();

  if (coordinates.Count <= 2)
  {
      Console.WriteLine("No hay suficientes puntos para crear un polígono.");
      return;
  }


  await leafletMap.Geometric.DisplayPolygonsFromArray.deleteAll();
  Console.WriteLine("Se eliminaron todos los polígonos.");
  await leafletMap.Geometric.DisplayPointsFromArray.deleteAllPoints();
  Console.WriteLine("Se eliminaron todos los puntos.");


  foreach (var point in coordinates)
  {
      await leafletMap.Geometric.DisplayPointsFromArray.addPoint(point, symbol);
      Console.WriteLine($"Punto agregado: [{point[0]}, {point[1]}]");
  }

  await leafletMap.Geometric.DisplayPolygonsFromArray.add(coordinates, new RealTimeMap.PolygonSymbol()
  {
      color = "yellow",
      fillColor = "orange",
      weight = 4,
      opacity = 0.4,
      fillOpacity = 0.4
  });
  Console.WriteLine("Polígono agregado.");

}

@ichim
Copy link
Owner

ichim commented Dec 10, 2024

Hello again,

I'm surprised that it works on Edge and not on Chrome. I often use Chrome. The error message is generated by the Leaflet core (not LeafletForBlazor) and seems to say that there is an error in the data.

@LuisFerMoreno
Copy link
Author

I already solve it, I just need to run "chrome://settings/reset" on the browser and works fine. Thank you for help friend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants