I have a table in database with following with latitude and longitude attribute
CREATE TABLE `companies` (
`ID` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`latitude` decimal(12,8) NOT NULL,
`longitude` decimal(12,8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `companies` (`ID`, `title`, `latitude`, `longitude`) VALUES
(NULL, 'John and SOns', '25.29064622', '55.368462502'),
(NULL, 'Evas', '25.28862850', '55.40107816');
On google map I have a polyline feature, where user can draw a polyline, so we can show all companies which are within that polygon.
Here is map image
Google may giving an array of latitude longitude
How I can query to fetch all records from database which lies within draw polygon?