Your search did not match any results.
Map

Markers

Documentation
The Map widget can display markers on the map. The collection of displayed markers is declared in the markers array. Markers can include tooltips that provide additional information.
@(Html.DevExtreme().Map() .ID("map") .Key(k => k.Google("AIzaSyDk2m6n8ICK7FSmTHBLlapAWF3epiDdkHE")) .Zoom(11) .Height(440) .Width("100%") .Controls(true) .MarkerIconSrc(new JS("markerUrl")) .Markers(markers => { markers.Add().Coordinates(40.755833, -73.986389).Tooltip(t => t.Text("Times Square")); markers.Add().Address("40.7825, -73.966111").Tooltip(t => t.Text("Central Park")); markers.Add().Coordinates(40.753889, -73.981389).Tooltip(t => t.Text("Fifth Avenue")); markers.Add().Address("Brooklyn Bridge,New York,NY").Tooltip(t => t.Text("Brooklyn Bridge")); }) ) @(Html.DevExtreme().CheckBox() .ID("use-custom-markers") .Value(true) .Text("Use custom marker icons") .OnValueChanged("checkBox_onValueChanged") ) <br /> @(Html.DevExtreme().Button() .ID("show-tooltips") .Text("Show all tooltips") .OnClick("button_onClick") ) <script> var markerUrl = "https://js.devexpress.com/Demos/RealtorApp/images/map-marker.png"; function checkBox_onValueChanged(data) { var mapWidget = $("#map").dxMap("instance"); var markersData = mapWidget.option("markers"); var newMarkers = $.map(markersData, function (item) { return $.extend(true, {}, item, { tooltip: { isShown: false }} ); }); mapWidget.option("markers", newMarkers); mapWidget.option("markerIconSrc", data.value ? markerUrl : null); } function button_onClick() { var mapWidget = $("#map").dxMap("instance"); var markersData = mapWidget.option("markers"); var newMarkers = $.map(markersData, function (item) { return $.extend(true, {}, item, { tooltip: { isShown: true }} ); }); mapWidget.option("markers", newMarkers); } </script>
using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Controllers { public class MapController : Controller { public ActionResult Markers() { return View(); } } }
#use-custom-markers { min-width: 240px; } #use-custom-markers, #show-tooltips { margin-top: 10px; margin-left: 10px; }