This topic is locked

Customize map marker description

6/17/2016 3:17:09 PM
ASPRunnerPro Tips and tricks
admin

Q: How to place description on each map marker
A:


  1. Modify SQL Query to create a calculated field with custom name and address.

SELECT

CustomerID,

CompanyName,

ContactName,

ContactTitle,

Address,

Lat,

Lng,

concat(ContactName, '\n', Address) as DisplayOnMap

FROM customers


Notice '\n', it allows us to create multiline descriptions. concat() function is MySQL specific. Similar functions exist in all databases.


2. Insert a map into List page. Here are settings I have used for this specific table.

' Longitude and latitude or address field should be specified

' name of field in table that used as address for map

mapSettings("addressField") = "DisplayOnMap"

' name of field in table that used as latitude for map

mapSettings("latField") = "Lat"

' name of field in table that used as longitude for map

mapSettings("lngField") = "Lng"


Latitude and Longitude fields are required as we use address field for marker description purposes.