Skip to content

Commit

Permalink
Added OrdnanceSurvey Bing Layer for UK users. (#891)
Browse files Browse the repository at this point in the history
Add Bing OSGB to mobile and desktop sites.
  • Loading branch information
damocov authored and vitalidze committed Oct 11, 2016
1 parent 3b14af5 commit 16caa7b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
*
* Copyright 2015 sourceforge.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gwtopenmaps.openlayers.client.layer;

/**
*
* @author Giuseppe La Scaleia - CNR IMAA geoSDI Group
* @email [email protected]
*/
public enum BingType {

ROAD("Road"),
HYBRID("AerialWithLabels"),
AERIAL("Aerial"),
ORDNANCESURVEY("ordnancesurvey");
//
private String value;

private BingType(String theValue) {
this.value = theValue;
}

@Override
public String toString() {
return value.toString();
}
}
2 changes: 2 additions & 0 deletions src/main/java/org/traccar/web/client/view/MapView.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ private Layer createMap(UserSettings.MapType mapType) {
return new Bing(new BingOptions(mapType.getName(), ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey(), BingType.ROAD));
case BING_HYBRID:
return new Bing(new BingOptions(mapType.getName(), ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey(), BingType.HYBRID));
case BING_ORDNANCE_SURVEY:
return new Bing(new BingOptions(mapType.getName(), ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey(), BingType.ORDNANCESURVEY));
case BING_AERIAL:
return new Bing(new BingOptions(mapType.getName(), ApplicationContext.getInstance().getApplicationSettings().getBingMapsKey(), BingType.AERIAL));
case STAMEN_TONER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public enum MapType implements IsSerializable {
BING_ROAD("Bing Road") { @Override public boolean isBing() { return true; } },
BING_HYBRID("Bing Hybrid") { @Override public boolean isBing() { return true; } },
BING_AERIAL("Bing Aerial") { @Override public boolean isBing() { return true; } },
BING_ORDNANCE_SURVEY("Bing Ordnance Survey") { @Override public boolean isBing() { return true; } },
STAMEN_TONER("Stamen Toner");

final String name;
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/m/js/traccar-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ myApp.onPageInit('map-screen', function(page) {
style = 'AerialWithLabels';
} else if (appState.userSettings.mapType == "BING_AERIAL") {
style = 'Aerial';
} else if (appState.userSettings.mapType == "BING_ORDNANCE_SURVEY") {
style = 'ORDNANCESURVEY';
}

layers.push(new ol.layer.Tile({
Expand Down Expand Up @@ -925,4 +927,4 @@ if (myApp.device.ios) {
$$(window).resize(function () {
$$('.panel-left').css({height: $$(window).height() + 'px'});
}).trigger('resize');
}
}

0 comments on commit 16caa7b

Please sign in to comment.