question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leaflet Map does not Center to Location after search

See original GitHub issue

Hi,

For some reason, the map does not center to the point of search result. It is able to autoComplete, but nothing happens after that.

I tried to check the object output from the search. mymap.on('geosearch/showlocation', function(result) { console.log(result); });

However, it returned a “TypeError: Cannot convert undefined or null to object”.

Hope that someone can assist. Thank you!!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
qzminskicommented, Aug 4, 2020

Looks like once I updated from 3.0.0 to 3.0.5 the problem is gone.

1reaction
nobbiexxxcommented, Apr 7, 2022

I’m getting the same thing with version 3.6.0 Has anyone figured it out?

Uncaught (in promise) TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at i.showResult (SearchControl.ts:412:28) at SearchControl.ts:404:12

Read more comments on GitHub >

github_iconTop Results From Across the Web

leaflet map does not centre correct - Stack Overflow
The map is not centred to the bounds, but the centre is more north from the markers. If zoomed in to much the...
Read more >
leaflet - The marker and center map are not in the right place
I'm starting use the Leaflet. I put a marker to test but neither the marker nor the center are in the right local...
Read more >
How to fix marker in center of leaflet map after user will drag ...
Hi I am using a custom map on my node add form. My marker is set to my current location using lat and...
Read more >
first render works, second render is not centered
Hello all, I have a mysterious problem where a simple map (just a single marker) renders fine the first time, but a second...
Read more >
Controlling Zoom and Pan | Maps JavaScript API
The following map demonstrates the default behavior for map interactions ... Note: The gestureHandling option does not apply to the Street View service....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found