we can pass code from php to js
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
function mp_init_map() {
|
||||
var locations = [
|
||||
{lat: 38.8833, lng: -77.0167},
|
||||
{lat: 39.8833, lng: -76.0167},
|
||||
];
|
||||
var map = new google.maps.Map(
|
||||
|
||||
/*
|
||||
* following variable are created by mp_locations.php
|
||||
* - let locations
|
||||
* - let icon_url
|
||||
*/
|
||||
|
||||
let map = new google.maps.Map(
|
||||
document.getElementById("ljdp_map"),
|
||||
{
|
||||
zoom: 5,
|
||||
@@ -11,11 +14,9 @@ function mp_init_map() {
|
||||
center: locations[0],
|
||||
}
|
||||
);
|
||||
var marker, icon;
|
||||
// icon = "/wp-content/plugins/map_prof/marker.png";
|
||||
let marker, icon;
|
||||
icon = {
|
||||
//url: document.location.href + "marker.png",
|
||||
url: "/wp-content/plugins/map_prof/marker.png",
|
||||
url: icon_url,
|
||||
scaledSize: new google.maps.Size(35, 50)
|
||||
};
|
||||
for (loc of locations) {
|
||||
|
||||
Reference in New Issue
Block a user