Comments (7)
First of all you should use map event to find when map is loaded. Check example in readme(front page)
OnAfterInit="@(async () => await OnAfterInitAsync())"
Second this is very bad. Component is redrawn each time any value changes and it will be trigered each time.
if (!firstRender)
Also you should try debug with edge application and see if any markers is added to markers.
In my opinion you should change and OnAfterInit event and it should work
from blazorgooglemaps.
@valentasm1 m1, thank you for the fast response. I implemented your suggestions but i still got the same problem.
Since i have the markers written out on the map, shouldnt they exist?
I did a Console.WriteLine(map) in the OnAfterInitAsync() method and in the method onFilterSelected. In the OnAfterInitAsync() method i find the object and get "GoogleMapsComponents.GoogleMap" written out and in the onFilterSelected method it writes out nothing.
It seems like i still have the same problem accessing the map object..
from blazorgooglemaps.
If i understand correctly it is not issue with accessing map. There is issue with Stack markers .
I think you should create github or zip solution that i could reproduce issue. You could make just part of not working. No need all solution.
Again i think this is not map issue, but something with lifecycle or business logic. Of course i could be wrong.
from blazorgooglemaps.
@valentasm1, I created a repo with the same problem: https://github.com/Essum13/GoogleMapsBlazorIssues.git
Wrote some comments inside the BaseClass.
(I removed valid google maps api key).
from blazorgooglemaps.
Thank you for you time preparing github. Now i get it.
Dont take anything personally. You inheritance is strange. I think i mixed up functionality. If two components inherit same base it doesnt mean they share same instance.
SearchComponent < MapBase
AND
Map < MapBase
You see. If you draw smth on map.razor then SearchComponent.razor < Map base doesnt know anything about it.
My suggestion is to create MyMapComponent where you bind Locations via [Parameter] property from parent component. Parent component have all info about locations and it changes then child will update automatically. Then on parent if you change Select control, then you already know info about locations.
My suggestion read this documentations. Especial part about child components which is relavant to you. It a bit hard to grasp so probably you will need to read several times and compare with other recourses.
https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-3.1
from blazorgooglemaps.
Closing
from blazorgooglemaps.
@valentasm1, ahhh that makes sense haha! Thank you for your time! I will solve my problem now.
from blazorgooglemaps.
Related Issues (20)
- Adding Blazor Custom Elements on to the map HOT 7
- oderv 10000 Markers HOT 1
- Warnings about deprecated fields due to `JSON.stringify` usage HOT 6
- Problem With .net 8 WebApp HOT 1
- Not able to run a Blank Project with GoogleMapsComponents HOT 1
- No RectangleList? (Cannot add previously saved Rectangle to map)
- Multi framework support
- Need server side demo with testing all components
- Did you have already Geolocation Support? HOT 3
- Need API documentation and support on Stack Overflow HOT 6
- Accessing the map object via javascript HOT 4
- Working with encoded polylines. HOT 2
- Multiple Ground Overlays HOT 3
- DrawingManager.SetDrawingMode no longer works in 3.3.2 and newer HOT 7
- Add class DragEndEvent for dragend listener (Suggestion) HOT 1
- MarkerClustering - Set Click on Zoom level; HOT 2
- polygonList not rendering the polygons HOT 9
- Advanced Markers server side demo dont work anymore HOT 4
- Link KeyProvider to map object scope instead of application level static HOT 2
- Advanced Marker Support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorgooglemaps.