Since days I tried to find the right place again and again but without any luck.
I can't find out where to place the map.panby ( x , y )
in my following google maps code to get the marker a bot more on the right.
It would be great if someone could help me!
Best
<script type="text/javascript">
var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(52.5200066, 13.404954);
var mapOptions = {
zoom: 6,
scrollwheel: false,
navigationControl: false,
mapTypeControl: false,
scaleControl: false,
draggable: false,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.LEFT_CENTER
},
streetViewControl:false,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [
{
"featureType": "administrative.country",
"elementType": "geometry",
"stylers": [
{ "weight": 1.2 },
{ "color": "#dd4b39" }
]
},{
"featureType": "administrative",
"stylers": [
{ "visibility": "simplified" }
]
},{
"featureType": "administrative.country",
"stylers": [
{ "visibility": "on" }
]
},{
"featureType": "administrative.locality",
"stylers": [
{ "visibility": "on" }
]
}
]
}
map = new google.maps.Map(document.getElementById('user-map-canvas'), mapOptions);
}
function showAddress(address) {
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Adresse konnte aus folgendem Grund nicht gefunden werden: " + status);
}
google.maps.event.addListener(marker, 'click', function() { // Add a Click Listener to our marker
window.location='/freiwillige/?s=<?php echo $country ?>'; // URL to Link Marker to (i.e Google Places Listing)
});
});
}
jQuery(document).ready( function() { initialize(); showAddress('<?php echo $address ?>'); } );
</script>