Visualforce Page Map(you can see the coordinates returned from the apex class just above the map - these are what the map is using.)Google Map(notice coordinates are the same as the VF page, but pin location is different)<!-- Display the address on a map -->
<apex:map width="600px" height="400px" mapType="roadmap" zoomLevel="17" center="{!program.Location__r.LatitudeTEXT__c},{!program.Location__r.LongitudeTEXT__c}">
<apex:mapMarker title="" position="{!program.Location__r.LatitudeTEXT__c},{!program.Location__r.LongitudeTEXT__c}"/>
</apex:map>
3 answers
Hi Benzy,If you already have the coordinates for the location you're interested in, you should pass them as string that represents a JSON object with 'latitude' and 'longitude' attributes that specify location coordinates. For example, in your case it should be:center="{latitude: 17.415886, longitude: 78.405906}", not center="17.415886, 78.405906" as you have it now.Another option is to use an Apex map object of type Map<String, Double>, with 'latitude' and 'longitude' keys. When you use just comma separated coordinates, the string is treated as an address string and is geocoded to determine actual latitude and longitude. It looks like geocoding returns slightly different latitude and longitude values and this causes the behavior that you observe. Hi, I have the same problem, but newbi here, how would the VF code from up look like?Thanks, Bjoern