I think the problem is in the training data, as you can see below there I put the php code and the rendering to explain.
I'm new to API to Google Maps, this is not my code. Then comes the problem: when to once zoom in on this pointer moves a lot when i zooming! I can not figure out what the conflict of maps displaying. I'd like to use only LatLong to indicate the area but the script is provided to calculate the road .. this is the second hypothesis.
What I tried:
- From:
setMapAddress ("<? Php city ();?>, <? Php been ();?>, <? Php zipcode ();?>");
- To
setMapAddress ("");
- Result:
setMapAddress (" , , ");
-deleting:
bed: "<?php beds(); ?>",
bath: "<?php baths(); ?>",
size: "<?php echo get_post_meta($post->ID, "_ct_sqft", true); ?> <?php sqftsqm(); ?>",
street: "<?php the_title(); ?>",
city: "<?php city(); ?>",
state: "<?php state(); ?>",
zip: "<?php zipcode(); ?>",
Image of issue:
<script>
function setMapAddress(address) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { address : address }, function( results, status ) {
if( status == google.maps.GeocoderStatus.OK ) {
<?php if((get_post_meta(get_the_ID(), "_ct_latlng", true))) { ?>
var location = new google.maps.LatLng(<?php echo get_post_meta(get_the_ID(), "_ct_latlng", true); ?>);
<?php } else { ?>
var location = results[0].geometry.location;
<?php } ?>
var options = {
zoom: 15,
center: location,
mapTypeId: google.maps.MapTypeId.<?php echo strtoupper($ct_options['ct_contact_map_type']); ?>,
streetViewControl: true
};
var mymap = new google.maps.Map( document.getElementById( 'map' ), options );
var marker = new MarkerWithLabel({
map: mymap,
draggable: false,
flat: true,
labelContent: '',
labelAnchor: new google.maps.Point(22, 0),
labelClass: "label", // the CSS class for the label
labelStyle: {opacity: 1},
icon: '<?php echo get_template_directory_uri(); ?>/images/blank.png',
<?php if((get_post_meta(get_the_ID(), "_ct_latlng", true))) { ?>
position: new google.maps.LatLng(<?php echo get_post_meta(get_the_ID(), "_ct_latlng", true); ?>)
<?php } else { ?>
position: results[0].geometry.location
<?php } ?>
});
}
});
}
setMapAddress( "<?php city(); ?>, <?php state(); ?>, <?php zipcode(); ?>" );
</script>
<div id="map"></div>
This code was rendered as:
<script>
function setMapAddress(address) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { address : address }, function( results, status ) {
if( status == google.maps.GeocoderStatus.OK ) {
var location = new google.maps.LatLng(42.608120,14.067420);
var options = {
zoom: 15,
center: location,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: true
};
var mymap = new google.maps.Map( document.getElementById( 'map' ), options );
var marker = new MarkerWithLabel({
map: mymap,
draggable: false,
flat: true,
labelContent: '',
labelAnchor: new google.maps.Point(22, 0),
labelClass: "label", // the CSS class for the label
labelStyle: {opacity: 1},
icon: 'http://pineto.contat.eu/wp-content/themes/th/images/blank.png',
position: new google.maps.LatLng(42.608120,14.067420)
});
}
});
}
setMapAddress( ", , " );
</script>