Dear All ,
Can the Blazor Maps control use custom background image for marker ?
same as the ASP.NET MVC - EJ 2 forums example : https://www.syncfusion.com/forums/142679/map-chart-with-custom-background-image
Best Regards,
Jacky
[_Host.cshtml]
<script>
function resizeMarkerTemplate() {
// code for sizing the marker template
}
</script>
[Index.razor]
<SfMaps>
<MapsEvents Loaded="Loaded"></MapsEvents>
</SfMaps>
@code
{
private async void Loaded() {
await jsRuntime.InvokeAsync<object>("resizeMarkerTemplate");
}
} |
Dear Indumathi ,
Thanks, I will try it first and look forward to your further details.
Best Regards,
Jacky
Dear Indumathi ,
Thanks for your reply.
my requirement as befor sample still have two :
1 . Can use the MapsZoomSettings to Resize the map ?
2 . And also place the marker for custom shapes by passing the coordinates into the marker latitude and longitude properties
Best regards,
Jacky
Screen 1
Screen 2
Hi Indumathi ,
My requirement is combine previous sample MarkerTemplate background image with boolon Marker,
Please see attach Combine Sample project index1.razor,
I try use shapdata for sublayer seems not work.
Kindly help. Thanks
Jacky
Dear Sir,
Thank you for your assistance.
If you don't consider the resizing problems caused by zoom (Zoom in/out), is it possible to simply mark the Ballon Marker on the Custom image map and display the Data Label information?
As mentioned in the previous forum, if Syncfusion ASP.NET MVC-EJ 2 can be implemented, Blazor Map control should be more advanced to be achieved.
I think that Geo Maps combined with Custom images to display in the manufacturing industry is a very straightforward application. Can it be included in the future plan of Syncfusion Blazor Map control?
Thank you for your time.
Best regards,
Jacky
Query |
Details |
If you don't consider the resizing problems caused by zoom (Zoom in/out), is it possible to simply mark the Ballon Marker on the Custom image map and display the Data Label information? |
We can achieve your requirement by placing the balloon type marker over the background image (rendered as marker template) if the zooming and resizing is not considered. We can use “z-index” CSS style to render the marker over the background image. Since the background image and marker will have synchronizing issues while resizing the window, we need to set fixed size to the Maps component.
Usually, data labels are rendered based on the shapes in the Maps. Since the layer has only marker template (background image), we can render the label as annotation using “MapsAnnotation” class. We have modified the provided sample to add markers and annotations above the background image and it can be found from the below link.
In the above sample, we have used the ”MapsAnnotation” class to specify the HTML element for adding the text to be displayed above the background image. We can place an annotation anywhere above the background image by specifying the "X" and "Y" properties using pixel.
We need to set the "ZIndex" property to place the annotation above the background image. |
As mentioned in the previous forum, if Syncfusion ASP.NET MVC-EJ 2 can be implemented, Blazor Map control should be more advanced to be achieved. |
We achieved something similar but not identical using the ASP.NET MVC EJ2 component, and only as a workaround by using the "loaded" event. In that example, we would not have enabled the zooming feature, and the markers would have been placed as shapes. However, the requirement in your query is different, as you have requested a zooming feature and marker templates with images. As a result, the sample prepared in the ASP.NET MVC EJ2 component is not exactly equivalent to your requirement. |
I think that Geo Maps combined with Custom images to display in the manufacturing industry is a very straightforward application. Can it be included in the future plan of Syncfusion Blazor Map control? |
As updated earlier, our Maps component is designed to work with shapes and online map providers. It does not handle images in the same way that an image viewer does. Also, because it isn't a generic requirement, we don't have any immediate plans to render and work on images in the Maps component. |
Dear Indumathi ,
Thank you for your prompt reply.
Your details explanation and example already met some of my requirement.
Thank you for taking time to reponse my email.
Best regards,
Jacky Liu