Hi,
I have a code where i get the location from a server and also some information. I used to use a pointstyle and textstyle to display it. but my requirement is to display a point and when hovered on that point i need the information on the popup. I am new to mvc and mapsuite.
The code i have for placing point is as follows:
[MapActionFilter]
public
void
RefreshMarkerOverlayss(Map map, Collection<
object
> args)
{
List<incident> positions =
new
List<incident>();
if
(map !=
null
)
{
TextStyle txtStyle =
new
TextStyle(
"Name"
,
new
GeoFont(
"Arial"
, 9),
new
GeoSolidBrush(
new
GeoColor(51, 155, 51)));
txtStyle.SuppressPartialLabels =
false
;
PointStyle ps =
new
PointStyle(PointSymbolType.Circle,
new
GeoSolidBrush(
new
GeoColor(255, 0, 0)), 10);
//List<double> position = new List<double>();
using
(WebClient webClient =
new
WebClient())
{
string
dwml;
dwml = webClient.DownloadString(ServiceUri +
"GetAllOpenIncidents/"
);
// position = JsonConvert.DeserializeObjectAsync
<list<double>>(dwml).Result;
positions = JsonConvert.DeserializeObjectAsync
<list<incident>>(dwml).Result;
}
int
sizes = positions.Count;
int
j;
var overLay = map.CustomOverlays[
"TOverLay"
]
as
LayerOverlay;
InMemoryFeatureLayer inMemoryLayer2 = overLay.Layers[1]
as
InMemoryFeatureLayer;
inMemoryLayer2.InternalFeatures.Clear();
for
(j = 0; j < sizes; j++)
{
double
x = positions[j].incidentPointLocationX;
double
y = positions[j].incidentPointLocationY;
//double y = Double.Parse(positions[j + 3].ToString());
string
z = positions[j].incidentPointName;
//string a = ". " + (string)positions[j+ 1];
PointShape Radarpoints =
new
PointShape(x, y);
Feature f2 =
new
Feature(
new
PointShape(x, y));
f2.ColumnValues[
"Name"
] = z;
inMemoryLayer2.InternalFeatures.Add(f2);
}
I want a similar code for popup.
Thanks