I have been trying to use google street maps with the help of OpenLayers, but Every time I am running into a problem with this google maps coordinates.
The Coordinates of a location named 'Asab, in Abu Dhabi' should have coordinates as "Longitude=54.3004105, Latitude=23.25535006" but instead it gives coordinates like "Long=6036690.74501, Lat=2700367.334".
The Code I used to include google maps into my HTML webpage is as below: var map;
function init(){
// Initiating 'map' Variable and Adding Controls
map = new OpenLayers.Map('map_element', {
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.ZoomBox(),
new OpenLayers.Control.ZoomToMaxExtent(),
new OpenLayers.Control.LayerSwitcher({}),
new OpenLayers.Control.MousePosition('mouse_position', { prefix: 'Long: ', separator: ' \n| Lat: '}),
new OpenLayers.Control.ScaleLine({}),
new OpenLayers.Control.OverviewMap()
]
});
// BaseMap Layers
var google_streets= new OpenLayers.Layer.Google(
'Google Streets',
{type: google.maps.MapTypeId.ROADMAP,
units: "m",
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34),
maxResolution: 1.40625
}, {"sphericalMercator": true}
);
So I have been looking all over to correct this but I am not getting how to do it. I am a new learner into this OpenLayers, so if someone can please give me push it would be really helpful.