Hi
I need to show floor plan drawings in svg format, its posible get this work with maps control?
Thanks in advance!
Hi Jose,
Thank you for contacting Syncfusion support.
We can render floor plans as custom shapes in the Maps component. To achieve this, a JSON file with GeoJSON format must be created. This file will contain your own coordinates with predefined shapes such as “Polygon”, “MultiPolygon” and so on. Please find the basic structure of the GeoJSON format below.
|
{ "type": "FeatureCollection", "features": [
{ "type": "Feature", "properties": { "Name": "Bureau_FT", "admin": "sbe", "stroke": "brown", "stroke-width": 2, "nameMemo": "Bureau_FT", "SpaceId": "20001" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.283750364095, 23.8647877753913 ], [ 21.483750364095, 23.8647877753913 ], [ 21.483750364095, 22.8647877753913 ], [ 19.283750364095, 22.8647877753913 ] ] ] } }, ] } |
Similar to the above structure, we must construct the map with your own data to render custom shapes in the Maps component. We have created a sample application to demonstrate the same and it can be downloaded from the below link.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp2-681393255
Please let us know if you need any further assistance.
Regards,
Indumathi R.
Hi Indumathi
Thanks for your great support
I just have many questions:
1) Its possible draw arcs, circles, curves?
2) Its possible fill a geometry/region, please check my attachments
3) Its possible draw text, please check my attachments
Thanks in advance!
Hi Jose,
Thank you for the update.
Please find the details for your queries from the below table.
|
Queries |
Details |
|
|
Its possible draw arcs, circles, curves? |
We can render arcs, circles and curves in the JSON file by creating coordinate points with pre-defined shapes like Polygon, Multipolygon, and so on in the GeoJSON data of the map. |
|
|
Its possible fill a geometry/region, please check my attachments |
We can fill colors to each shape using “ColorValuePath” property and data source of the layer. The “ShapeDataPath” and “ShapePropertyPath” properties are used to connect the data source with the shape data of the Maps. The “ShapeDataPath” takes the field name from the data source as value whereas “ShapePropertyPath” property takes the field name from the shape data of the map as value. When the values of both the properties match, we can apply colors based on color values by binding the field name to the “ColorValuePath” property in the “MapsShapeSettings”. Please find the code snippet for the same below.
Code Snippet:
|
|
|
Its possible draw text, please check my attachments |
We can render text in the shape of the Maps by binding the field name from the data source to the “ValuePath” property in the “MapsDataLabelSettings”. Please find the code snippet for the same below.
Code Snippet:
We have created a sample to demonstrate the same and it can be downloaded from the below link.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp2-1275054229 |
Please let us know if the above solution meets your requirement
Regards,
Indumathi R.
Hi Indumathi
Excellent example.
Without abusing your great support, my floor maps are in svg, what starting point do you recommend to migrate from svg to the json format that the map library requires?
Thanks in advance!
Hi Jose,
Thank you for the update.
We do not handle conversion of an SVG document to a JSON file with GeoJSON format. However, you can look for online vendors to convert the SVG to JSON file or manually create the JSON file.
Please let us know if you need any further assistance.
Regards,
Indumathi R.