Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
48 views

Hello,

is it possible to show the Marker Tooltips initially (code behind)?

i didnt find any example.

 

 

 

Manuel
Top achievements
Rank 1
 asked on 01 Jun 2023
1 answer
60 views

I'm using OpenStreetMap as the MapLayer

 

Is there a way to add a search address box?

 

 

Attila Antal
Telerik team
 answered on 27 Mar 2023
14 answers
164 views

I get following error with RadMap:


[InvalidOperationException: Fehler während der Serialisierung oder Deserialisierung mit JSON-"JavaScriptSerializer". Die Länge der Zeichenfolge übersteigt den in der maxJsonLength-Eigenschaft festgelegten Wert.]
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +759618
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +103
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +178
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +47
   Telerik.Web.UI.AdvancedJavaScriptSerializer.Serialize(Object obj) +102
   Telerik.Web.UI.RadMap.DescribeComponent(IScriptDescriptor descriptor) +54
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) +180
   Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors() +9
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +164
   Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors() +153
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +122
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer) +148
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +334
   System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +58
   Telerik.Web.UI.OurUpdatePanel.Render(HtmlTextWriter writer) +264
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.PreControlToAjaxify.Render(HtmlTextWriter writer) +147
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661639
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +1016
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239

It seems  problem just occurs, when there are more then 3024 Markers on the map. Below this count there is now problem.

 

I allready changed the MaxJsonLength in the web.config. That changed nothing.


Versionsinformationen: Microsoft .NET Framework-Version:4.0.30319; ASP.NET-Version:4.8.4494.0

Chris
Top achievements
Rank 1
Iron
Iron
 answered on 14 Mar 2023
1 answer
75 views

How can I create a custom shape (polygon) using Json object with coordinates after OnClick event in Javascript? 

I've tried the following but I'm getting an error:   Uncaught TypeError: a3.slice is not a function

 

                    function initialize(sender, eventArgs) {{

                        var shapeData = {{
                          ""type"": ""GeometryCollection"",
                          ""geometries"": [
                            {{
                              ""type"": ""LineString"",
                              ""coordinates"": [
                                [
                                  12.47633,
                                  41.9106979    
                                ],
                                [
                                  12.4764271,
                                  41.9060326
                                ],
                                [
                                  12.4664,
                                  41.90369
                                ],
                                [
                                  12.4535074,
                                  41.90665
                                ],
                                [
                                  12.47633,
                                  41.9106979
                                ]
                              ]
                            }}
                          ]
                        }};

                        var originalOptions = eventArgs.get_options();
                        originalOptions.layers[1].dataSource = {{ data: shapeData }};
                        eventArgs.set_options(originalOptions);

                    }}

 

Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
 answered on 20 Dec 2022
1 answer
66 views
I know we can add lines to a RadMap. I would like these lines to resemble arrows and have some curvature. Is it possible?
Valentin Dragnev
Telerik team
 answered on 09 Nov 2022
1 answer
60 views

How can i make a popup on a layer click with information (name,etc...).

On Telerik Radmap Asp.net

 

Attila Antal
Telerik team
 answered on 04 Jul 2022
1 answer
109 views

I'm mapping locations.  some times companies have multiple assets at the same address or same Longitude/Latitude.  When this is rendered on the map it shows up as one pin and all the rest get lost in the ether.  I ran across some Kendo example that is supposed to pad the pins.  It doesn't work.  How do we get multiple pins to render at the same location or how do we get one pin to show multiple sets of data?

Map code is pretty simple:

    <telerik:RadMap RenderMode="Lightweight" runat="server" ID="mapSite" Zoom="4" CssClass="MyMap Rounded" Width="100%" Height="100%">
        <DataBindings>
            <MarkerBinding DataShapeField="Shape" DataTitleField="SITE_CITY" DataLocationLatitudeField="Latitude" DataLocationLongitudeField="Longitude" />
        </DataBindings>
        <LayersCollection>
            <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                UrlTemplate="https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                Attribution="">
            </telerik:MapLayer>
        </LayersCollection>
    </telerik:RadMap>

Code behind:

Binding code:

            Dim res = From x In db.SITEs
                      Where x.COMPANY.COMPANY_CODE.Equals(Session("Market").ToString)
                      Select New clsSiteData With {
                          .Shape = "PinTarget",
                          .SITE_ID = x.SITE_ID,
                          .SITE_CODE = x.SITE_CODE,
                          .SITE_NAME = x.SITE_NAME,
                          .SITE_ADDRESS_1 = x.SITE_ADDRESS_1,
                          .SITE_ADDRESS_2 = x.SITE_ADDRESS_2,
                          .SITE_CITY = x.SITE_CITY,
                          .STATE_CODE = x.STATE.STATE_CODE,
                          .POSTAL_CODE = x.SITE_POSTAL_CODE,
                          .BUILDING_ID = x.SITE_BUILDING_IDENTIFIER,
                          .PROPERTY_ID = x.PROPERTY_CODE.PROPERTY_CODE,
                          .Latitude = If(x.SITE_MAP_LAT, 0),
                          .Longitude = If(x.SITE_MAP_LON, 0)
                          }

            mapSite.DataSource = res.ToList
            mapSite.DataBind()

ItemDataBound:

Private Sub mapSite_ItemDataBound(sender AsObject, e As MapItemDataBoundEventArgs) Handles mapSite.ItemDataBound Dim htmlTemplate AsStringTry hlAssInv.Visible = CType(ViewState("Asset"), Boolean) htmlTemplate = getInnerHTML(tblTemplate) Dim marker As MapMarker = TryCast(e.Item, MapMarker) If marker IsNothingThenReturnEndIfDim item As clsSiteData = TryCast(e.DataItem, clsSiteData) marker.TooltipSettings.Content = [String].Format(htmlTemplate, item.SITE_CODE, item.SITE_NAME, item.SITE_ADDRESS_1, item.SITE_ADDRESS_2, item.SITE_CITY, item.STATE_CODE, item.POSTAL_CODE, item.BUILDING_ID, item.PROPERTY_ID, item.SITE_ID) Catch ex As Exception Dim xxx AsString = ex.Message.ToString End Try

End Sub


Peter Milchev
Telerik team
 answered on 07 Jun 2022
1 answer
90 views

In my maps ItemDataBound event I'm building the markers tooltip.  The tooltip has an image in it that also acts as a hyperlink.  So this works:

Dim TOOLTIP_TEMPLATE As String = "<a href=""Reports.aspx"" target=""_self""><img src=""Images/inventory.png"" /></a>"

This does not:

Dim TOOLTIP_TEMPLATE As String = "<asp:HyperLink runat=""server"" ImageUrl=""Images/inventory.png"" NavigateUrl=""~/Reports.aspx"" ToolTip=""To Inventory""></asp:HyperLink>"
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 22 Apr 2022
1 answer
336 views

Does anyone know what the CSP (Content-Security-Policy) be implemented for both HTTP and HTTPS when using Bing for the MapLayer control?

This is what I have, which breaks the map feature:

     <meta http-equiv="Content-Security-Policy"
    content="script-src 'self' 'unsafe-inline' 'unsafe-eval' https://aspnet-scripts.telerikstatic.com ;
             style-src 'self' 'unsafe-inline' https://aspnet-skins.telerikstatic.com ;
             font-src 'self' https://aspnet-skins.telerikstatic.com ;
             img-src 'self' https://aspnet-skins.telerikstatic.com " />

The error is: 

Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken...yada yada yada.. Refused to load the script 'http://dev.virtualearth.net/REST/v1/Imagery/Metadata/road?output=json&jsonp=bingTileParams&include=ImageryProviders&key=my key&callback=bingTileParams&_=1649186230772' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://aspnet-scripts.telerikstatic.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I'm new to having to use CSP so I could really use your help.

Rumen
Telerik team
 answered on 06 Apr 2022
1 answer
97 views

I'm using the RadMap to show states of the USA.

layers[0] is Bing.
layers[1] contains a shape for every US state/territory.
layers[2-53] contain the counties (subdivisions) for each state/territory.

When the user clicks a state, I handle the shapeClick event to .show() the corresponding layer for the state's counties. This works fine.

Once layer 2 - 53 is shown, however, the shapeClick no longer fires when a shape in layer 1 is clicked, presumably because it is no longer "on top" and shapeClick is only fired for layer x. Is there a way to receive shapeClick events no matter which layer is "on top"?

If not, is there a way to get the data from the map's regular Click event and somehow use that to determine the shape that covers it in layer 1?

Vessy
Telerik team
 answered on 26 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?