-
Notifications
You must be signed in to change notification settings - Fork 1
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
Initialize MapOptions #1
Comments
I apologize for the late response, I have updated the readme file to contain more information regarding this issue. It is contained in step 5 of the documentation. |
thank you. |
Dear jgraves I have created Map element with MapOptions defined: Code:
the above results in the map not being rendered i.e. just beige background with no tiles rendered. panning/zooming the map gives the following error in browser's developer console: I will appreciate your assistance to resolve the above. Regards |
Would you send me your index.html if you're using WASM, or _host.cshtml if
you're using server?
…On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.***> wrote:
Dear jgraves
I have created Map element with MapOptions defined:
<Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement">
Code:
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng = 28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
the above results in the map not being rendered i.e. just beige background
with no tiles rendered. panning/zooming the map gives the following error
in browser's developer console:
map.js:55 Uncaught TypeError: Cannot read properties of null (reading
'zoom')
at Vka (map.js:55:513)
at HTMLDivElement. (map.js:54:453)
Vka @ map.js:55
(anonymous) @ map.js:54
I will appreciate your assistance to resolve the above.
Regards
Kobus
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Thank you for prompt response. Here is the content of index.html for WASM:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>bzrUI</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css" rel="stylesheet" />
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
<link href="bzrUI.Client.styles.css" rel="stylesheet" />
</head>
<body>
<div id="app">Loading...</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry> &libraries=drawing,geometry></script>
<script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
</body>
</html>
Regards
Kobus Lombard
E-mail: ***@***.***> ***@***.***
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.***>
Sent: 11 July 2022 16:18
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue #1)
Would you send me your index.html if you're using WASM, or _host.cshtml if
you're using server?
On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***> > wrote:
Dear jgraves
I have created Map element with MapOptions defined:
<Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement">
Code:
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng = 28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
the above results in the map not being rendered i.e. just beige background
with no tiles rendered. panning/zooming the map gives the following error
in browser's developer console:
map.js:55 Uncaught TypeError: Cannot read properties of null (reading
'zoom')
at Vka (map.js:55:513)
at HTMLDivElement. (map.js:54:453)
Vka @ map.js:55
(anonymous) @ map.js:54
I will appreciate your assistance to resolve the above.
Regards
Kobus
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.*** <mailto:***@***.***> >
—
Reply to this email directly, view it on GitHub <#1 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ> .
You are receiving this because you modified the open/close state. <https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif> Message ID: ***@***.*** ***@***.***> >
|
try replacing your google maps script tag:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
with this:
<script src="
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry
"></script>
it is formatted incorrectly and I'm pretty sure that is why your maps
aren't loading. The maps library isn't loading so it can't create the map.
…On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.***> wrote:
Thank you for prompt response. Here is the content of index.html for WASM:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no" />
<title>bzrUI</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link
href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
rel="stylesheet" />
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
<link href="bzrUI.Client.styles.css" rel="stylesheet" />
</head>
<body>
<div id="app">Loading...</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
<script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
</body>
</html>
Regards
Kobus Lombard
E-mail: ***@***.***> ***@***.***
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.***>
Sent: 11 July 2022 16:18
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
#1)
Would you send me your index.html if you're using WASM, or _host.cshtml if
you're using server?
On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***>
> wrote:
> Dear jgraves
>
> I have created Map element with MapOptions defined:
> <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
> Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> MapRightClicked((MapLatLng)e)"
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement">
>
> Code:
> private MapOptions mapOpt { get; set; }
> protected async override Task OnInitializedAsync()
> {
> await base.OnInitializedAsync();
>
> while (gMap is null)
> {
> await Task.Delay(25);
> }
>
> mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
28.0}, zoom = 15, tilt = 0 };
>
> StateHasChanged();
> }
>
> the above results in the map not being rendered i.e. just beige
background
> with no tiles rendered. panning/zooming the map gives the following error
> in browser's developer console:
> map.js:55 Uncaught TypeError: Cannot read properties of null (reading
> 'zoom')
> at Vka (map.js:55:513)
> at HTMLDivElement. (map.js:54:453)
> Vka @ map.js:55
> (anonymous) @ map.js:54
>
> I will appreciate your assistance to resolve the above.
>
> Regards
> Kobus
>
> —
> Reply to this email directly, view it on GitHub
> <
#1 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.*** <mailto:***@***.***> >
>
—
Reply to this email directly, view it on GitHub <
#1 (comment)>
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state. <
https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif>
Message ID: ***@***.*** ***@***.***> >
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hi Rocco
I think something went wrong with the copy/paste of index.html into the email because the script is correctly configured in index.html:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry> &libraries=drawing,geometry></script>
Two scenarios: i) without MapOptions set and first attachment:
<Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) => MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)" MapId="MapElement"></Map>
ii) with MapOptions set and initalised and second attachment with blank page, just standard google beige background:
<Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) => MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)" MapId="MapElement"></Map>
@code {
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng = 28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
Regards
Kobus Lombard
E-mail: ***@***.***> ***@***.***
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.***>
Sent: 11 July 2022 16:27
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue #1)
try replacing your google maps script tag:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
https://maps.googleapis.com/maps/api/js?key= <https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry> &libraries=drawing,geometry>
&libraries=drawing,geometry></script>
with this:
<script src="
https://maps.googleapis.com/maps/api/js?key= <https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry> &libraries=drawing,geometry
"></script>
it is formatted incorrectly and I'm pretty sure that is why your maps
aren't loading. The maps library isn't loading so it can't create the map.
On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.*** <mailto:***@***.***> > wrote:
Thank you for prompt response. Here is the content of index.html for WASM:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no" />
<title>bzrUI</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link
href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
rel="stylesheet" />
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
<link href="bzrUI.Client.styles.css" rel="stylesheet" />
</head>
<body>
<div id="app">Loading...</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0 <https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry> &libraries=drawing,geometry>
&libraries=drawing,geometry></script>
<script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
</body>
</html>
Regards
Kobus Lombard
E-mail: ***@***.*** <mailto:***@***.***> > ***@***.*** <mailto:***@***.***>
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.*** <mailto:***@***.***> >
Sent: 11 July 2022 16:18
To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> >
Cc: lombardk ***@***.*** <mailto:***@***.***> >; State change ***@***.*** <mailto:***@***.***> >
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
#1)
Would you send me your index.html if you're using WASM, or _host.cshtml if
you're using server?
On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
> wrote:
> Dear jgraves
>
> I have created Map element with MapOptions defined:
> <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
> Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> MapRightClicked((MapLatLng)e)"
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement">
>
> Code:
> private MapOptions mapOpt { get; set; }
> protected async override Task OnInitializedAsync()
> {
> await base.OnInitializedAsync();
>
> while (gMap is null)
> {
> await Task.Delay(25);
> }
>
> mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
28.0}, zoom = 15, tilt = 0 };
>
> StateHasChanged();
> }
>
> the above results in the map not being rendered i.e. just beige
background
> with no tiles rendered. panning/zooming the map gives the following error
> in browser's developer console:
> map.js:55 Uncaught TypeError: Cannot read properties of null (reading
> 'zoom')
> at Vka (map.js:55:513)
> at HTMLDivElement. (map.js:54:453)
> Vka @ map.js:55
> (anonymous) @ map.js:54
>
> I will appreciate your assistance to resolve the above.
>
> Regards
> Kobus
>
> —
> Reply to this email directly, view it on GitHub
> <
#1 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
>
—
Reply to this email directly, view it on GitHub <
#1 (comment)>
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state. <
https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif>
Message ID: ***@***.*** <mailto:***@***.***> ***@***.*** <mailto:***@***.***> > >
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.*** <mailto:***@***.***> >
—
Reply to this email directly, view it on GitHub <#1 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMO3JYRB65ZLZYHVF2NARGTVTQVNDANCNFSM5UP2VNTQ> .
You are receiving this because you modified the open/close state. <https://github.com/notifications/beacon/AMO3JYQWK7ROOI3EBNVUD4DVTQVNDA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOLHNA.gif> Message ID: ***@***.*** ***@***.***> >
|
Wait, are you saying that your script tag looks like this:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
…On Mon, Jul 11, 2022 at 9:01 AM lombardk ***@***.***> wrote:
Hi Rocco
I think something went wrong with the copy/paste of index.html into the
email because the script is correctly configured in index.html:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
Two scenarios: i) without MapOptions set and first attachment:
<Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)"
Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e)
=> MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement"></Map>
ii) with MapOptions set and initalised and second attachment with blank
page, just standard google beige background:
<Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement"></Map>
@code {
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
Regards
Kobus Lombard
E-mail: ***@***.***> ***@***.***
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.***>
Sent: 11 July 2022 16:27
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
#1)
try replacing your google maps script tag:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
https://maps.googleapis.com/maps/api/js?key= <
https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
with this:
<script src="
https://maps.googleapis.com/maps/api/js?key= <
https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
&libraries=drawing,geometry
"></script>
it is formatted incorrectly and I'm pretty sure that is why your maps
aren't loading. The maps library isn't loading so it can't create the map.
On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.*** <mailto:***@***.***>
> wrote:
> Thank you for prompt response. Here is the content of index.html for
WASM:
>
>
>
>
>
> <!DOCTYPE html>
>
> <html lang="en">
>
>
>
> <head>
>
> <meta charset="utf-8" />
>
> <meta name="viewport" content="width=device-width, initial-scale=1.0,
> maximum-scale=1.0, user-scalable=no" />
>
> <title>bzrUI</title>
>
> <base href="/" />
>
> <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
>
> <link href="css/app.css" rel="stylesheet" />
>
>
>
> <link
> href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
> rel="stylesheet" />
>
> <script
src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
>
>
>
> <link href="bzrUI.Client.styles.css" rel="stylesheet" />
>
> </head>
>
>
>
> <body>
>
> <div id="app">Loading...</div>
>
>
>
> <div id="blazor-error-ui">
>
> An unhandled error has occurred.
>
> <a href="" class="reload">Reload</a>
>
> <a class="dismiss">🗙</a>
>
> </div>
>
> <script src="_framework/blazor.webassembly.js"></script>
>
>
>
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
>
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0
<
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry>
&libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
>
> <script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
>
>
>
> </body>
>
>
>
> </html>
>
>
>
> Regards
>
>
>
> Kobus Lombard
>
>
>
>
>
>
>
> E-mail: ***@***.*** <mailto:***@***.***> > ***@***.*** <mailto:***@***.***>
>
> Cellphone: +27 82 853 2806
>
> FAX: +27 86 585 9382
>
>
>
> From: Rocco ***@***.*** <mailto:***@***.***> >
> Sent: 11 July 2022 16:18
> To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> >
> Cc: lombardk ***@***.*** <mailto:***@***.***> >; State change
***@***.*** <mailto:***@***.***> >
> Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
> #1)
>
>
>
> Would you send me your index.html if you're using WASM, or _host.cshtml
if
> you're using server?
>
> On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***>
<mailto:***@***.***>
> > wrote:
>
> > Dear jgraves
> >
> > I have created Map element with MapOptions defined:
> > <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
> > Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> > MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> > MapRightClicked((MapLatLng)e)"
> > Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> > MapId="MapElement">
> >
> > Code:
> > private MapOptions mapOpt { get; set; }
> > protected async override Task OnInitializedAsync()
> > {
> > await base.OnInitializedAsync();
> >
> > while (gMap is null)
> > {
> > await Task.Delay(25);
> > }
> >
> > mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
> 28.0}, zoom = 15, tilt = 0 };
> >
> > StateHasChanged();
> > }
> >
> > the above results in the map not being rendered i.e. just beige
> background
> > with no tiles rendered. panning/zooming the map gives the following
error
> > in browser's developer console:
> > map.js:55 Uncaught TypeError: Cannot read properties of null (reading
> > 'zoom')
> > at Vka (map.js:55:513)
> > at HTMLDivElement. (map.js:54:453)
> > Vka @ map.js:55
> > (anonymous) @ map.js:54
> >
> > I will appreciate your assistance to resolve the above.
> >
> > Regards
> > Kobus
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
>
#1 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
> >
> > .
> > You are receiving this because you modified the open/close
state.Message
> > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> >
>
>
>
> —
> Reply to this email directly, view it on GitHub <
>
#1 (comment)
>
> , or unsubscribe <
>
https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ
>
> .
> You are receiving this because you modified the open/close state. <
>
https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif
>
> Message ID: ***@***.*** <mailto:***@***.***> ***@***.*** <mailto:***@***.***>
> >
>
> —
> Reply to this email directly, view it on GitHub
> <
#1 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ
>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.*** <mailto:***@***.***> >
>
—
Reply to this email directly, view it on GitHub <
#1 (comment)>
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AMO3JYRB65ZLZYHVF2NARGTVTQVNDANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state. <
https://github.com/notifications/beacon/AMO3JYQWK7ROOI3EBNVUD4DVTQVNDA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOLHNA.gif>
Message ID: ***@***.*** ***@***.***> >
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENQWHGRHBFVDIHHEUTLVTQZM3ANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Does it work if you do it without assigning any MapOptions values? like if
you just leave the options null?
…On Mon, Jul 11, 2022 at 9:05 AM Joey Graves ***@***.***> wrote:
Wait, are you saying that your script tag looks like this:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
&libraries=drawing,geometry></script>
On Mon, Jul 11, 2022 at 9:01 AM lombardk ***@***.***> wrote:
> Hi Rocco
>
>
>
> I think something went wrong with the copy/paste of index.html into the
> email because the script is correctly configured in index.html:
>
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
> https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
>
>
>
>
>
> Two scenarios: i) without MapOptions set and first attachment:
>
> <Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)"
> Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e)
> => MapRightClicked((MapLatLng)e)"
>
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement"></Map>
>
>
>
> ii) with MapOptions set and initalised and second attachment with blank
> page, just standard google beige background:
>
> <Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
> MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> MapRightClicked((MapLatLng)e)"
>
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement"></Map>
>
> @code {
>
> private MapOptions mapOpt { get; set; }
>
>
>
> protected async override Task OnInitializedAsync()
>
> {
>
> await base.OnInitializedAsync();
>
>
>
> while (gMap is null)
>
> {
>
> await Task.Delay(25);
>
> }
>
>
>
> mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
> 28.0}, zoom = 15, tilt = 0 };
>
>
>
> StateHasChanged();
>
> }
>
>
>
> Regards
>
>
>
> Kobus Lombard
>
>
>
>
>
>
>
> E-mail: ***@***.***> ***@***.***
>
> Cellphone: +27 82 853 2806
>
> FAX: +27 86 585 9382
>
>
>
> From: Rocco ***@***.***>
> Sent: 11 July 2022 16:27
> To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
> Cc: lombardk ***@***.***>; State change ***@***.***>
> Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
> #1)
>
>
>
> try replacing your google maps script tag:
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
> https://maps.googleapis.com/maps/api/js?key= <
> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
> &libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
> with this:
> <script src="
> https://maps.googleapis.com/maps/api/js?key= <
> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
> &libraries=drawing,geometry
> "></script>
> it is formatted incorrectly and I'm pretty sure that is why your maps
> aren't loading. The maps library isn't loading so it can't create the map.
>
> On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.*** <mailto:***@***.***>
> > wrote:
>
> > Thank you for prompt response. Here is the content of index.html for
> WASM:
> >
> >
> >
> >
> >
> > <!DOCTYPE html>
> >
> > <html lang="en">
> >
> >
> >
> > <head>
> >
> > <meta charset="utf-8" />
> >
> > <meta name="viewport" content="width=device-width, initial-scale=1.0,
> > maximum-scale=1.0, user-scalable=no" />
> >
> > <title>bzrUI</title>
> >
> > <base href="/" />
> >
> > <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
> >
> > <link href="css/app.css" rel="stylesheet" />
> >
> >
> >
> > <link
> > href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
> > rel="stylesheet" />
> >
> > <script
> src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
> >
> >
> >
> > <link href="bzrUI.Client.styles.css" rel="stylesheet" />
> >
> > </head>
> >
> >
> >
> > <body>
> >
> > <div id="app">Loading...</div>
> >
> >
> >
> > <div id="blazor-error-ui">
> >
> > An unhandled error has occurred.
> >
> > <a href="" class="reload">Reload</a>
> >
> > <a class="dismiss">🗙</a>
> >
> > </div>
> >
> > <script src="_framework/blazor.webassembly.js"></script>
> >
> >
> >
> > <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
> >
> https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0
> <
> https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry>
> &libraries=drawing,geometry>
> > &libraries=drawing,geometry></script>
> >
> > <script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
> >
> >
> >
> > </body>
> >
> >
> >
> > </html>
> >
> >
> >
> > Regards
> >
> >
> >
> > Kobus Lombard
> >
> >
> >
> >
> >
> >
> >
> > E-mail: ***@***.*** <mailto:***@***.***> > ***@***.*** <mailto:***@***.***>
>
> >
> > Cellphone: +27 82 853 2806
> >
> > FAX: +27 86 585 9382
> >
> >
> >
> > From: Rocco ***@***.*** <mailto:***@***.***> >
> > Sent: 11 July 2022 16:18
> > To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> >
> > Cc: lombardk ***@***.*** <mailto:***@***.***> >; State change
> ***@***.*** <mailto:***@***.***> >
> > Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
> > #1)
> >
> >
> >
> > Would you send me your index.html if you're using WASM, or _host.cshtml
> if
> > you're using server?
> >
> > On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***>
> <mailto:***@***.***>
> > > wrote:
> >
> > > Dear jgraves
> > >
> > > I have created Map element with MapOptions defined:
> > > <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
> > > Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> > > MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> > > MapRightClicked((MapLatLng)e)"
> > > Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> > > MapId="MapElement">
> > >
> > > Code:
> > > private MapOptions mapOpt { get; set; }
> > > protected async override Task OnInitializedAsync()
> > > {
> > > await base.OnInitializedAsync();
> > >
> > > while (gMap is null)
> > > {
> > > await Task.Delay(25);
> > > }
> > >
> > > mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
> > 28.0}, zoom = 15, tilt = 0 };
> > >
> > > StateHasChanged();
> > > }
> > >
> > > the above results in the map not being rendered i.e. just beige
> > background
> > > with no tiles rendered. panning/zooming the map gives the following
> error
> > > in browser's developer console:
> > > map.js:55 Uncaught TypeError: Cannot read properties of null (reading
> > > 'zoom')
> > > at Vka (map.js:55:513)
> > > at HTMLDivElement. (map.js:54:453)
> > > Vka @ map.js:55
> > > (anonymous) @ map.js:54
> > >
> > > I will appreciate your assistance to resolve the above.
> > >
> > > Regards
> > > Kobus
> > >
> > > —
> > > Reply to this email directly, view it on GitHub
> > > <
> >
> #1 (comment)
> > >,
> > > or unsubscribe
> > > <
> >
> https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
> > >
> > > .
> > > You are receiving this because you modified the open/close
> state.Message
> > > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> > >
> >
> >
> >
> > —
> > Reply to this email directly, view it on GitHub <
> >
> #1 (comment)
> >
> > , or unsubscribe <
> >
> https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ
> >
> > .
> > You are receiving this because you modified the open/close state. <
> >
> https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif
> >
> > Message ID: ***@***.*** <mailto:***@***.***> ***@***.*** <mailto:***@***.***>
> > >
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
> #1 (comment)
> >,
> > or unsubscribe
> > <
> https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ
> >
> > .
> > You are receiving this because you modified the open/close state.Message
> > ID: ***@***.*** <mailto:***@***.***> >
> >
>
>
>
> —
> Reply to this email directly, view it on GitHub <
> #1 (comment)>
> , or unsubscribe <
> https://github.com/notifications/unsubscribe-auth/AMO3JYRB65ZLZYHVF2NARGTVTQVNDANCNFSM5UP2VNTQ>
> .
> You are receiving this because you modified the open/close state. <
> https://github.com/notifications/beacon/AMO3JYQWK7ROOI3EBNVUD4DVTQVNDA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOLHNA.gif>
> Message ID: ***@***.*** ***@***.***> >
>
> —
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFDBENQWHGRHBFVDIHHEUTLVTQZM3ANCNFSM5UP2VNTQ>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
|
Hi Rocco
Same problem occurs with:
<Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) => MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)" MapId="MapElement"></Map>
@code {
private Map gMap { get; set; }
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
// mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng = 28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
Ps: I am using Visual Studio 2022 Preview for MAC. I will test on Visual Studio 2022 for Windows as well just in case.
Regards
Kobus Lombard
From: Rocco ***@***.***>
Sent: 11 July 2022 17:21
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue #1)
Does it work if you do it without assigning any MapOptions values? like if
you just leave the options null?
On Mon, Jul 11, 2022 at 9:05 AM Joey Graves ***@***.*** <mailto:***@***.***> > wrote:
Wait, are you saying that your script tag looks like this:
<script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx <https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry> &libraries=drawing,geometry>
&libraries=drawing,geometry></script>
On Mon, Jul 11, 2022 at 9:01 AM lombardk ***@***.*** <mailto:***@***.***> > wrote:
> Hi Rocco
>
>
>
> I think something went wrong with the copy/paste of index.html into the
> email because the script is correctly configured in index.html:
>
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
> https://maps.googleapis.com/maps/api/js?key=xxxxxxx <https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry> &libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
>
>
>
>
>
> Two scenarios: i) without MapOptions set and first attachment:
>
> <Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)"
> Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e)
> => MapRightClicked((MapLatLng)e)"
>
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement"></Map>
>
>
>
> ii) with MapOptions set and initalised and second attachment with blank
> page, just standard google beige background:
>
> <Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
> MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> MapRightClicked((MapLatLng)e)"
>
> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> MapId="MapElement"></Map>
>
> @code {
>
> private MapOptions mapOpt { get; set; }
>
>
>
> protected async override Task OnInitializedAsync()
>
> {
>
> await base.OnInitializedAsync();
>
>
>
> while (gMap is null)
>
> {
>
> await Task.Delay(25);
>
> }
>
>
>
> mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
> 28.0}, zoom = 15, tilt = 0 };
>
>
>
> StateHasChanged();
>
> }
>
>
>
> Regards
>
>
>
> Kobus Lombard
>
>
>
>
>
>
>
> E-mail: ***@***.*** <mailto:***@***.***> > ***@***.*** <mailto:***@***.***>
>
> Cellphone: +27 82 853 2806
>
> FAX: +27 86 585 9382
>
>
>
> From: Rocco ***@***.*** <mailto:***@***.***> >
> Sent: 11 July 2022 16:27
> To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> >
> Cc: lombardk ***@***.*** <mailto:***@***.***> >; State change ***@***.*** <mailto:***@***.***> >
> Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
> #1)
>
>
>
> try replacing your google maps script tag:
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
> https://maps.googleapis.com/maps/api/js?key= <
> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20 <https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry> &libraries=drawing,geometry>
> &libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
> with this:
> <script src="
> https://maps.googleapis.com/maps/api/js?key= <
> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20 <https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry> &libraries=drawing,geometry>
> &libraries=drawing,geometry
> "></script>
> it is formatted incorrectly and I'm pretty sure that is why your maps
> aren't loading. The maps library isn't loading so it can't create the map.
>
> On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
> > wrote:
>
> > Thank you for prompt response. Here is the content of index.html for
> WASM:
> >
> >
> >
> >
> >
> > <!DOCTYPE html>
> >
> > <html lang="en">
> >
> >
> >
> > <head>
> >
> > <meta charset="utf-8" />
> >
> > <meta name="viewport" content="width=device-width, initial-scale=1.0,
> > maximum-scale=1.0, user-scalable=no" />
> >
> > <title>bzrUI</title>
> >
> > <base href="/" />
> >
> > <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
> >
> > <link href="css/app.css" rel="stylesheet" />
> >
> >
> >
> > <link
> > href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
> > rel="stylesheet" />
> >
> > <script
> src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
> >
> >
> >
> > <link href="bzrUI.Client.styles.css" rel="stylesheet" />
> >
> > </head>
> >
> >
> >
> > <body>
> >
> > <div id="app">Loading...</div>
> >
> >
> >
> > <div id="blazor-error-ui">
> >
> > An unhandled error has occurred.
> >
> > <a href="" class="reload">Reload</a>
> >
> > <a class="dismiss">🗙</a>
> >
> > </div>
> >
> > <script src="_framework/blazor.webassembly.js"></script>
> >
> >
> >
> > <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
> >
> https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0
> <
> https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0 <https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry> &libraries=drawing,geometry>
> &libraries=drawing,geometry>
> > &libraries=drawing,geometry></script>
> >
> > <script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
> >
> >
> >
> > </body>
> >
> >
> >
> > </html>
> >
> >
> >
> > Regards
> >
> >
> >
> > Kobus Lombard
> >
> >
> >
> >
> >
> >
> >
> > E-mail: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> > ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
>
> >
> > Cellphone: +27 82 853 2806
> >
> > FAX: +27 86 585 9382
> >
> >
> >
> > From: Rocco ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> > Sent: 11 July 2022 16:18
> > To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> > Cc: lombardk ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >; State change
> ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> > Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
> > #1)
> >
> >
> >
> > Would you send me your index.html if you're using WASM, or _host.cshtml
> if
> > you're using server?
> >
> > On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
> <mailto:***@***.***>
> > > wrote:
> >
> > > Dear jgraves
> > >
> > > I have created Map element with MapOptions defined:
> > > <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
> > > Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
> > > MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
> > > MapRightClicked((MapLatLng)e)"
> > > Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
> > > MapId="MapElement">
> > >
> > > Code:
> > > private MapOptions mapOpt { get; set; }
> > > protected async override Task OnInitializedAsync()
> > > {
> > > await base.OnInitializedAsync();
> > >
> > > while (gMap is null)
> > > {
> > > await Task.Delay(25);
> > > }
> > >
> > > mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
> > 28.0}, zoom = 15, tilt = 0 };
> > >
> > > StateHasChanged();
> > > }
> > >
> > > the above results in the map not being rendered i.e. just beige
> > background
> > > with no tiles rendered. panning/zooming the map gives the following
> error
> > > in browser's developer console:
> > > map.js:55 Uncaught TypeError: Cannot read properties of null (reading
> > > 'zoom')
> > > at Vka (map.js:55:513)
> > > at HTMLDivElement. (map.js:54:453)
> > > Vka @ map.js:55
> > > (anonymous) @ map.js:54
> > >
> > > I will appreciate your assistance to resolve the above.
> > >
> > > Regards
> > > Kobus
> > >
> > > —
> > > Reply to this email directly, view it on GitHub
> > > <
> >
> #1 (comment)
> > >,
> > > or unsubscribe
> > > <
> >
> https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
> > >
> > > .
> > > You are receiving this because you modified the open/close
> state.Message
> > > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> <mailto:***@***.***> >
> > >
> >
> >
> >
> > —
> > Reply to this email directly, view it on GitHub <
> >
> #1 (comment)
> >
> > , or unsubscribe <
> >
> https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ
> >
> > .
> > You are receiving this because you modified the open/close state. <
> >
> https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif
> >
> > Message ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
> > >
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
> #1 (comment)
> >,
> > or unsubscribe
> > <
> https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ
> >
> > .
> > You are receiving this because you modified the open/close state.Message
> > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
> >
>
>
>
> —
> Reply to this email directly, view it on GitHub <
> #1 (comment)>
> , or unsubscribe <
> https://github.com/notifications/unsubscribe-auth/AMO3JYRB65ZLZYHVF2NARGTVTQVNDANCNFSM5UP2VNTQ>
> .
> You are receiving this because you modified the open/close state. <
> https://github.com/notifications/beacon/AMO3JYQWK7ROOI3EBNVUD4DVTQVNDA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOLHNA.gif>
> Message ID: ***@***.*** <mailto:***@***.***> ***@***.*** <mailto:***@***.***> > >
>
> —
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFDBENQWHGRHBFVDIHHEUTLVTQZM3ANCNFSM5UP2VNTQ>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.*** <mailto:***@***.***> >
>
—
Reply to this email directly, view it on GitHub <#1 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMO3JYQZMON5HX3X3JOIDTLVTQ3WXANCNFSM5UP2VNTQ> .
You are receiving this because you modified the open/close state. <https://github.com/notifications/beacon/AMO3JYSLRUIQIU4VVL3SQNLVTQ3WXA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZO3GFA.gif> Message ID: ***@***.*** ***@***.***> >
|
Sorry, I meant to remove the line code 'MapOptions="MapOpt"' from the Map
Component.
…On Mon, Jul 11, 2022, 9:38 AM lombardk ***@***.***> wrote:
Hi Rocco
Same problem occurs with:
<Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement"></Map>
@code {
private Map gMap { get; set; }
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
// mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
Ps: I am using Visual Studio 2022 Preview for MAC. I will test on Visual
Studio 2022 for Windows as well just in case.
Regards
Kobus Lombard
From: Rocco ***@***.***>
Sent: 11 July 2022 17:21
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
#1)
Does it work if you do it without assigning any MapOptions values? like if
you just leave the options null?
On Mon, Jul 11, 2022 at 9:05 AM Joey Graves ***@***.*** <mailto:***@***.***>
> wrote:
> Wait, are you saying that your script tag looks like this:
> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
> https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
&libraries=drawing,geometry>
> &libraries=drawing,geometry></script>
>
>
> On Mon, Jul 11, 2022 at 9:01 AM lombardk ***@***.*** <mailto:***@***.***>
> wrote:
>
>> Hi Rocco
>>
>>
>>
>> I think something went wrong with the copy/paste of index.html into the
>> email because the script is correctly configured in index.html:
>>
>> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
>> https://maps.googleapis.com/maps/api/js?key=xxxxxxx <
https://maps.googleapis.com/maps/api/js?key=xxxxxxx&libraries=drawing,geometry>
&libraries=drawing,geometry>
>> &libraries=drawing,geometry></script>
>>
>>
>>
>>
>>
>> Two scenarios: i) without MapOptions set and first attachment:
>>
>> <Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)"
>> Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)"
Map_RightClick="(e)
>> => MapRightClicked((MapLatLng)e)"
>>
>> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
>> MapId="MapElement"></Map>
>>
>>
>>
>> ii) with MapOptions set and initalised and second attachment with blank
>> page, just standard google beige background:
>>
>> <Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
>> MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
>> MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
>> MapRightClicked((MapLatLng)e)"
>>
>> Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
>> MapId="MapElement"></Map>
>>
>> @code {
>>
>> private MapOptions mapOpt { get; set; }
>>
>>
>>
>> protected async override Task OnInitializedAsync()
>>
>> {
>>
>> await base.OnInitializedAsync();
>>
>>
>>
>> while (gMap is null)
>>
>> {
>>
>> await Task.Delay(25);
>>
>> }
>>
>>
>>
>> mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
>> 28.0}, zoom = 15, tilt = 0 };
>>
>>
>>
>> StateHasChanged();
>>
>> }
>>
>>
>>
>> Regards
>>
>>
>>
>> Kobus Lombard
>>
>>
>>
>>
>>
>>
>>
>> E-mail: ***@***.*** <mailto:***@***.***> > ***@***.*** <mailto:***@***.***>
>>
>> Cellphone: +27 82 853 2806
>>
>> FAX: +27 86 585 9382
>>
>>
>>
>> From: Rocco ***@***.*** <mailto:***@***.***> >
>> Sent: 11 July 2022 16:27
>> To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***> >
>> Cc: lombardk ***@***.*** <mailto:***@***.***> >; State change
***@***.*** <mailto:***@***.***> >
>> Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue
>> #1)
>>
>>
>>
>> try replacing your google maps script tag:
>> <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
>> https://maps.googleapis.com/maps/api/js?key= <
>> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20 <
https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
&libraries=drawing,geometry>
>> &libraries=drawing,geometry>
>> &libraries=drawing,geometry></script>
>> with this:
>> <script src="
>> https://maps.googleapis.com/maps/api/js?key= <
>> https://maps.googleapis.com/maps/api/js?key=%20%20%20%20 <
https://maps.googleapis.com/maps/api/js?key=%20%20%20%20&libraries=drawing,geometry>
&libraries=drawing,geometry>
>> &libraries=drawing,geometry
>> "></script>
>> it is formatted incorrectly and I'm pretty sure that is why your maps
>> aren't loading. The maps library isn't loading so it can't create the
map.
>>
>> On Mon, Jul 11, 2022 at 8:23 AM lombardk ***@***.*** <mailto:***@***.***>
<mailto:***@***.***>
>> > wrote:
>>
>> > Thank you for prompt response. Here is the content of index.html for
>> WASM:
>> >
>> >
>> >
>> >
>> >
>> > <!DOCTYPE html>
>> >
>> > <html lang="en">
>> >
>> >
>> >
>> > <head>
>> >
>> > <meta charset="utf-8" />
>> >
>> > <meta name="viewport" content="width=device-width, initial-scale=1.0,
>> > maximum-scale=1.0, user-scalable=no" />
>> >
>> > <title>bzrUI</title>
>> >
>> > <base href="/" />
>> >
>> > <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
>> >
>> > <link href="css/app.css" rel="stylesheet" />
>> >
>> >
>> >
>> > <link
>> > href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css"
>> > rel="stylesheet" />
>> >
>> > <script
>> src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
>> >
>> >
>> >
>> > <link href="bzrUI.Client.styles.css" rel="stylesheet" />
>> >
>> > </head>
>> >
>> >
>> >
>> > <body>
>> >
>> > <div id="app">Loading...</div>
>> >
>> >
>> >
>> > <div id="blazor-error-ui">
>> >
>> > An unhandled error has occurred.
>> >
>> > <a href="" class="reload">Reload</a>
>> >
>> > <a class="dismiss">🗙</a>
>> >
>> > </div>
>> >
>> > <script src="_framework/blazor.webassembly.js"></script>
>> >
>> >
>> >
>> > <script src=https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxx <
>> >
>>
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0
>> <
>>
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0
<
https://maps.googleapis.com/maps/api/js?key=AIzaSyAU-oXXdwT4v5Z7ZE_NTMc8gDWubj-kWC0&libraries=drawing,geometry>
&libraries=drawing,geometry>
>> &libraries=drawing,geometry>
>> > &libraries=drawing,geometry></script>
>> >
>> > <script src="_content/BlazorGoogleMapsV3/JS/map.js"></script>
>> >
>> >
>> >
>> > </body>
>> >
>> >
>> >
>> > </html>
>> >
>> >
>> >
>> > Regards
>> >
>> >
>> >
>> > Kobus Lombard
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > E-mail: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
***@***.*** <mailto:***@***.***> <mailto:***@***.***>
>>
>> >
>> > Cellphone: +27 82 853 2806
>> >
>> > FAX: +27 86 585 9382
>> >
>> >
>> >
>> > From: Rocco ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
>> > Sent: 11 July 2022 16:18
>> > To: jgraves3gt/Blazor-GoogleMaps ***@***.*** <mailto:***@***.***>
<mailto:***@***.***> >
>> > Cc: lombardk ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
>; State change
>> ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
>> > Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions
(Issue
>> > #1)
>> >
>> >
>> >
>> > Would you send me your index.html if you're using WASM, or
_host.cshtml
>> if
>> > you're using server?
>> >
>> > On Mon, Jul 11, 2022, 12:09 AM lombardk ***@***.*** <mailto:***@***.***>
<mailto:***@***.***>
>> <mailto:***@***.***>
>> > > wrote:
>> >
>> > > Dear jgraves
>> > >
>> > > I have created Map element with MapOptions defined:
>> > > <Map @ref <https://github.com/ref>="gMap" MapOptions="mapOpt"
>> > > Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
>> > > MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
>> > > MapRightClicked((MapLatLng)e)"
>> > > Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
>> > > MapId="MapElement">
>> > >
>> > > Code:
>> > > private MapOptions mapOpt { get; set; }
>> > > protected async override Task OnInitializedAsync()
>> > > {
>> > > await base.OnInitializedAsync();
>> > >
>> > > while (gMap is null)
>> > > {
>> > > await Task.Delay(25);
>> > > }
>> > >
>> > > mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng
=
>> > 28.0}, zoom = 15, tilt = 0 };
>> > >
>> > > StateHasChanged();
>> > > }
>> > >
>> > > the above results in the map not being rendered i.e. just beige
>> > background
>> > > with no tiles rendered. panning/zooming the map gives the following
>> error
>> > > in browser's developer console:
>> > > map.js:55 Uncaught TypeError: Cannot read properties of null
(reading
>> > > 'zoom')
>> > > at Vka (map.js:55:513)
>> > > at HTMLDivElement. (map.js:54:453)
>> > > Vka @ map.js:55
>> > > (anonymous) @ map.js:54
>> > >
>> > > I will appreciate your assistance to resolve the above.
>> > >
>> > > Regards
>> > > Kobus
>> > >
>> > > —
>> > > Reply to this email directly, view it on GitHub
>> > > <
>> >
>>
#1 (comment)
>> > >,
>> > > or unsubscribe
>> > > <
>> >
>>
https://github.com/notifications/unsubscribe-auth/AFDBENRPRI52MUAI6HJWGJLVTO3CZANCNFSM5UP2VNTQ
>> > >
>> > > .
>> > > You are receiving this because you modified the open/close
>> state.Message
>> > > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> <mailto:***@***.***>
>
>> > >
>> >
>> >
>> >
>> > —
>> > Reply to this email directly, view it on GitHub <
>> >
>>
#1 (comment)
>> >
>> > , or unsubscribe <
>> >
>>
https://github.com/notifications/unsubscribe-auth/AMO3JYRUKOXFXI2Z7BBCUZDVTQUINANCNFSM5UP2VNTQ
>> >
>> > .
>> > You are receiving this because you modified the open/close state. <
>> >
>>
https://github.com/notifications/beacon/AMO3JYX6HPT6HCGP3ISX263VTQUINA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOIJEA.gif
>> >
>> > Message ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***>
***@***.*** <mailto:***@***.***> <mailto:***@***.***>
>> > >
>> >
>> > —
>> > Reply to this email directly, view it on GitHub
>> > <
>>
#1 (comment)
>> >,
>> > or unsubscribe
>> > <
>>
https://github.com/notifications/unsubscribe-auth/AFDBENV7VJ6YWTP2LRZGWS3VTQU6JANCNFSM5UP2VNTQ
>> >
>> > .
>> > You are receiving this because you modified the open/close
state.Message
>> > ID: ***@***.*** <mailto:***@***.***> <mailto:***@***.***> >
>> >
>>
>>
>>
>> —
>> Reply to this email directly, view it on GitHub <
>>
#1 (comment)
>
>> , or unsubscribe <
>>
https://github.com/notifications/unsubscribe-auth/AMO3JYRB65ZLZYHVF2NARGTVTQVNDANCNFSM5UP2VNTQ
>
>> .
>> You are receiving this because you modified the open/close state. <
>>
https://github.com/notifications/beacon/AMO3JYQWK7ROOI3EBNVUD4DVTQVNDA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZOLHNA.gif
>
>> Message ID: ***@***.*** <mailto:***@***.***> ***@***.*** <mailto:***@***.***>
> >
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <
#1 (comment)
>,
>> or unsubscribe
>> <
https://github.com/notifications/unsubscribe-auth/AFDBENQWHGRHBFVDIHHEUTLVTQZM3ANCNFSM5UP2VNTQ
>
>> .
>> You are receiving this because you modified the open/close state.Message
>> ID: ***@***.*** <mailto:***@***.***> >
>>
>
—
Reply to this email directly, view it on GitHub <
#1 (comment)>
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AMO3JYQZMON5HX3X3JOIDTLVTQ3WXANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state. <
https://github.com/notifications/beacon/AMO3JYSLRUIQIU4VVL3SQNLVTQ3WXA5CNFSM5UP2VNT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIZO3GFA.gif>
Message ID: ***@***.*** ***@***.***> >
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFDBENR6DT5QSJMFBBH7ODDVTQ5VZANCNFSM5UP2VNTQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hi Rocco
With following changes, map renders correctly but the MapOptions are not applied i.e. map does not locate to specified latlng.
<Map @ref="gMap" Map_Click="(e) => MapClicked((MapLatLng)e)" Map_DoubleClick="(e) => MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) => MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)" MapId="MapElement"></Map>
@code {
private Map gMap { get; set; }
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng = 28.0}, zoom = 15, tilt = 0 };
gMap.MapOptions = mapOpt;
StateHasChanged();
}
}
Do you perhaps have a working example of how to apply MapOptions?
Regards
Kobus Lombard
E-mail: ***@***.***> ***@***.***
Cellphone: +27 82 853 2806
FAX: +27 86 585 9382
From: Rocco ***@***.***>
Sent: 11 July 2022 19:22
To: jgraves3gt/Blazor-GoogleMaps ***@***.***>
Cc: lombardk ***@***.***>; State change ***@***.***>
Subject: Re: [jgraves3gt/Blazor-GoogleMaps] Initialize MapOptions (Issue #1)
Sorry, I meant to remove the line code 'MapOptions="MapOpt"' from the Map
Component.
…On Mon, Jul 11, 2022, 9:38 AM lombardk ***@***.*** <mailto:***@***.***> > wrote:
Hi Rocco
Same problem occurs with:
<Map @ref="gMap" MapOptions="mapOpt" Map_Click="(e) =>
MapClicked((MapLatLng)e)" Map_DoubleClick="(e) =>
MapDoubleClicked((MapLatLng)e)" Map_RightClick="(e) =>
MapRightClicked((MapLatLng)e)"
Marker_Click="(e) => MarkerClicked((MapElementMouseEvent)e)"
MapId="MapElement"></Map>
@code {
private Map gMap { get; set; }
private MapOptions mapOpt { get; set; }
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
while (gMap is null)
{
await Task.Delay(25);
}
// mapOpt = new MapOptions { center = new MapLatLng { lat = -25.4, lng =
28.0}, zoom = 15, tilt = 0 };
StateHasChanged();
}
Ps: I am using Visual Studio 2022 Preview for MAC. I will test on Visual
Studio 2022 for Windows as well just in case.
Regards
Kobus Lombard
|
Dear jgraves
Please update the sample to show how MapOptions must be initialized to change center/zoom.
The text was updated successfully, but these errors were encountered: