urlTemplate on maps-layer wont work

Hy at all

I have a Map an my MVC Page and i like to display a normal map like Openmap.
But i only get a gray map.
I have testet various url for the property "urlTemplate".


This is my code:

<ejs-maps id="maps" markerClick="window.markerClick">
    <e-maps-centerposition Latitude="48.16542" Longitude="14.03664"></e-maps-centerposition>
    <e-maps-zoomsettings enable="true" EnablePanning="true" horizontalAlignment="Center"
    ZoomFactor="15" EnableSelectionZooming="true" DoubleClickZoom="true" MaxZoom="30" MinZoom="5"
        ></e-maps-zoomsettings>
    <e-maps-layers>
        <e-maps-layer shapeData="mapEuData" urlTemplate="http://a.tile.openstreetmap.org/level/tileX/tileY.png">
            <e-layersettings-markers>
             <e-layersettings-marker visible="true" shape="Circle" fill="white"
                                            width="2" animationDuration="500" tooltipSettings="tooltip"
                                            border="border" dataSource="Helper.MapAdverts">
                                        </e-layersettings-marker>
         </e-layersettings-markers>
         <e-layersettings-shapesettings colorValuePath="density" fill="#E5E5E5" colorMapping="colormapping"></e-layersettings-shapesettings>
        </e-maps-layer>
    </e-maps-layers>
</ejs-maps>

Can this be a cross-site issue? Is this only working on SSL?

I only get this map:
map.png


1 Reply

IR Indumathi Ravi Syncfusion Team August 1, 2022 02:00 PM UTC

Hi Sascha,


Thank you for contacting Syncfusion support.


We identified that you have used both  “urlTemplate” and “shapeData” properties in the “e-maps-layer” tag in the provided code snippet. Only the “urlTemplate” property in the tag must be set if you want to render online map providers. So, you must remove the “shapeData” property, to render the online map providers in the Maps component. Please find the code snippet for the same below.


Code Snippet:

<ejs-maps>

     <e-maps-layers>

           <e-maps-layer  urlTemplate=http://a.tile.openstreetmap.org/level/tileX/tileY.png></e-maps-layer>

     </e-maps-layers>

</ejs-maps>


To know more about the online map providers in the Maps component, please refer the below documentation.

https://ej2.syncfusion.com/aspnetcore/documentation/maps/providers/map-provider


Please let us know if you need any further assistance.


Regards,

Indumathi R.


Loader.
Up arrow icon