Skip to content

Commit 1492399

Browse files
committed
SFV-1542
Updating to use the new google layers, this should hold for now.
1 parent df5e346 commit 1492399

File tree

1 file changed

+31
-28
lines changed
  • oscar/src/main/javascript/oscar/lib/oscar/ox

1 file changed

+31
-28
lines changed

oscar/src/main/javascript/oscar/lib/oscar/ox/ox.js

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -342,33 +342,36 @@ oscar.ox.Layer = oscar.BaseClass({
342342
}
343343
var olLayer = null;
344344
var onEvents = null;
345+
var aliasproj = new OpenLayers.Projection("EPSG:3857");
345346
switch (this.layerType) {
346-
case "GOOGLE_PHYSICAL":
347-
olLayer = new OpenLayers.Layer.Google("Google Physical", {
348-
type : G_PHYSICAL_MAP,
349-
sphericalMercator : true
350-
});
351-
352-
break;
353-
case "GOOGLE_STREETS":
354-
olLayer = new OpenLayers.Layer.Google("Google Streets", {
355-
type : G_NORMAL_MAP,
356-
sphericalMercator : true
357-
});
358-
break;
359-
360-
case "GOOGLE_HYBRID":
361-
olLayer = new OpenLayers.Layer.Google("Google Hybrid", {
362-
type : G_HYBRID_MAP,
363-
sphericalMercator : true
364-
});
365-
break;
366-
case "GOOGLE_SATELLITE":
367-
olLayer = new OpenLayers.Layer.Google("Google Satellite", {
368-
type : G_SATELLITE_MAP,
369-
sphericalMercator : true
370-
});
371-
break;
347+
case "GOOGLE_PHYSICAL":
348+
olLayer = new OpenLayers.Layer.Google("Google Physical", {
349+
type :google.maps.MapTypeId.TERRAIN,
350+
sphericalMercator :true
351+
});
352+
olLayer.projection = aliasproj;
353+
break;
354+
case "GOOGLE_STREETS":
355+
olLayer = new OpenLayers.Layer.Google("Google Streets", {
356+
sphericalMercator :true
357+
});
358+
olLayer.projection = aliasproj;
359+
break;
360+
361+
case "GOOGLE_HYBRID":
362+
olLayer = new OpenLayers.Layer.Google("Google Hybrid", {
363+
type :google.maps.MapTypeId.HYBRID,
364+
sphericalMercator :true
365+
});
366+
olLayer.projection = aliasproj;
367+
break;
368+
case "GOOGLE_SATELLITE":
369+
olLayer = new OpenLayers.Layer.Google("Google Satellite", {
370+
type :google.maps.MapTypeId.SATELLITE,
371+
sphericalMercator :true
372+
});
373+
olLayer.projection = aliasproj;
374+
break;
372375
case "MARKER":
373376
var externalProjection = null;
374377
if (this.parameters.srs) {
@@ -637,6 +640,7 @@ oscar.ox.Layer = oscar.BaseClass({
637640
break;
638641
case "OSM":
639642
olLayer = new OpenLayers.Layer.OSM(this.name);
643+
olLayer.projection = aliasproj;
640644
break;
641645
case "WMS":
642646
var params = {};
@@ -666,8 +670,7 @@ oscar.ox.Layer = oscar.BaseClass({
666670
buffer : 0
667671
});
668672
break;
669-
}
670-
;
673+
};
671674

672675
if (olLayer != null) {
673676
map.addLayer(olLayer);

0 commit comments

Comments
 (0)