Witam
Chce dodać do swojej mapy miniatury zdjęć za pomocą OpenLayers.Layer.Text
Jednak wzorując się na tym przykładzie:
http://www.oesterlin.ile.nc/test/20110824drv-carte.html nie wychodzi mi. Nie widać punktów.
Mój plik .js
Kod:
function init() {
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
var map = new OpenLayers.Map({
div: "map", allOverlays: true,
layers: [
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22,visibility: false}
),
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN, visibility: false}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: false}
),
new OpenLayers.Layer.Text("Photos",{location:"photos.txt", projection: epsg4326})
],
controls: [
new OpenLayers.Control.Navigation({
dragPanOptions: {
enableKinetic: true
}
}),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Attribution()
],
center: [0, 0],
zoom: 3
});
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(10.2, 48.9).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
), 5);
}
I plik photos.txt
Kod:
lat lon title description iconSize iconOffset icon
52.166806 21.075375 Photo <html><a href="ssFUJIF550sample-209.JPG" target="_blank"><img src="ssFUJIF550sample-209MIN.JPG" width="180" border="1"></a><br>photo</html> ssFUJIF550sample-209.JPG 18,13