My experience in javascript is lacking terribly.. And just this one question alone will solve about 90% of my problems at current!
So here I have a map that displays, and their is a marker langlat placed already in the .js file, what I require is to be able to add markers through php, so I'm assuming I'll have to pass an array foreach and run the script to add each marker. But accessing the function appears to be my main issue.
<div class="col-md-6">
<div class="content-wrap" id="map">
<div class="wrapper" >
</div>
</div>
</div>
<script src="js/maps.js"></script>
<script src="plugins/gmaps.js"></script>
maps.js
var googlemap = function () {
var map;
return {
init: function () {
map = new GMaps({
div: "#map",
lat: ***,
lng: ***
});
map.addMarker({
lat: ***,
lng: ***,
title: "Marker with InfoWindow",
infoWindow: {
content: "<p>***</p>"
}
});
}
};
}();
$(function () {
"use strict";
googlemap.init();
});
How do I reach the function in the .php file?
also note, the current map markers in the .js function work correctly.