Tell us what you are trying to do? Set a default position form map in post creation CRED form and enable setting position by click to the map and then drag.
So I need to use this for the marker:
function initMarkers( map ) {
var marker;
google.maps.event.addListener(map, 'click', function(event) {
placeMarker(event.latLng);
});
function placeMarker(location) {
if (marker == null)
{
marker = new google.maps.Marker({
position: location,
map: map,
draggable:true,
animation: google.maps.Animation.DROP,
title:"Drag me!"
});
function handleDrag(event) {
updateFields(event.latLng)
}
marker.addListener("drag", handleDrag)
marker.addListener("dragend", handleDrag)
}
else
{
marker.setPosition(location);
}
updateFields(location);
}
}
And this to center the map where I need it:
/**
* centerMap
*/
function centerMap( map ) {
var location = {lat: 49.81749199999999, lng: 15.472962}; // Czech republic
map.setCenter(location);
}
Is there any documentation that you are following? I have done it before with Google maps javascript API, but not with cred shortcode...
Is there a similar example that we can see? Yes I built it with Fluent Forms, but I need to use the Toolset instead hidden link
What is the link to your site? hidden link
Also, I need to enable In Map zoom with CTRL + mousewheel.