Forums: Customize map marker description - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Customize map marker description

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15435
  • Joined: 03-February 03

Posted 17 June 2016 - 07:23 PM

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.

Posted Image

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.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic