Changeset 9423 in ntrip
- Timestamp:
- May 6, 2021, 9:47:40 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/map/map_osm.html
r5385 r9423 12 12 </style> 13 13 14 <script src="http ://openlayers.org/api/OpenLayers.js" ></script>14 <script src="https://openlayers.org/api/OpenLayers.js" ></script> 15 15 16 16 <script> … … 18 18 var markers; 19 19 var marker; 20 var icon; 20 var icon; 21 21 var traceIcon; 22 22 var fromProjection; … … 28 28 function initialize(lat, lon, mapWinDotSize, mapWinDotColor) { 29 29 dotSize = mapWinDotSize; 30 dotColor = mapWinDotColor;30 dotColor = mapWinDotColor; 31 31 32 32 if (dotSize > 10) dotSize = 10; … … 38 38 fromProjection = new OpenLayers.Projection("EPSG:4326"); // WGS 1984 39 39 toProjection = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator 40 zoom = 0; 40 zoom = 0; 41 41 42 map.addLayer(new OpenLayers.Layer.OSM()); 42 map.addLayer(new OpenLayers.Layer.OSM("OpenStreetMap", 43 // Official OSM tileset as forced HTTPS URLs 44 [ 'https://a.tile.openstreetmap.de/${z}/${x}/${y}.png', 45 'https://b.tile.openstreetmap.de/${z}/${x}/${y}.png', 46 'https://c.tile.openstreetmap.de/${z}/${x}/${y}.png' 47 ],{tileOptions : {crossOriginKeyword: null}})); 43 48 var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection); 44 49 … … 48 53 49 54 var sizeT = new OpenLayers.Size(dotSize,dotSize); 50 var offsetT = new OpenLayers.Pixel(-sizeT.w/2, -13);51 if (dotColor == 1) {55 var offsetT = new OpenLayers.Pixel(-sizeT.w/2, -13); 56 if (dotColor == 1) { 52 57 traceIcon = new OpenLayers.Icon("qrc:///map/reddot.png", sizeT, offsetT); 53 }54 if (dotColor == 2) {58 } 59 if (dotColor == 2) { 55 60 traceIcon = new OpenLayers.Icon("qrc:///map/yellowdot.png", sizeT, offsetT); 56 }61 } 57 62 58 63 markers = new OpenLayers.Layer.Markers("Markers");
Note:
See TracChangeset
for help on using the changeset viewer.