Google Map Bounds Coordinates
See original GitHub issueThe google map api we can get the bounds via these methods:
const bounds = map.getBounds();
const ne = bounds.getNorthEast();
const sw = bounds.getSouthWest();
Does this library support anything like this?
Update: I’m trying to use jsinterop to call these methods:
private async Task OnMapBoundsChanged()
{
var _mapsJs = await _js.InvokeAsync<IJSObjectReference>("import", "./_content/Majorsoft.Blazor.Components.Maps/googleMaps.min.js");
await _mapsJs.InvokeVoidAsync("getBounds", _map.MapId);
}
But its not working, (I’m new to js interop), its throwing:
Error: Microsoft.JSInterop.JSException: Could not find 'getBounds' ('getBounds' was undefined).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Coordinates | Maps JavaScript API
A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian. Access by calling ...
Read more >Can I view a Google Maps map by bounding latitude and ...
With Google Maps I can enter a single lat/lng coordinate and the map is drawn with that lat/lng in the center.
Read more >Maximum Lat and Long bounds for the world - Google ...
But if you just want an answer for the maximum bounds for Google Maps: Latitude: -85 to +85 (actually -85.05115 for some reason)....
Read more >Google Maps JavaScript API V3 Reference
Google Maps JavaScript API V3 Reference ... This is an index of all the classes, methods, and interfaces in the Maps JavaScript API...
Read more >getBounds() in Google Maps API v3 - AIO Collective
So to get our latitude and longitude we need to move getBounds(), to some event listener. Description of bounds_changed in documentation is: “ ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Regarding this, the API also offers restrictions on the map bounds, so you can limit the map to a certain country for example. This is documented here.
I think this is might be quite easy to implement as it only requires changes in the
window.initGoogleMaps
function, specifically the map initializer.It would be nice if the
InnerElementReference
would actually contain the map object so we can work with it…Sure no problem once you confirm it is ok I will add it to the next Nuget package release. Since it Christmas etc. the release will be done next year…