friseurteam gallery map
This commit is contained in:
parent
ec038e3dee
commit
d834c90db7
@ -153,6 +153,11 @@ a {
|
||||
border-radius: 0 0 5px 0;
|
||||
}
|
||||
|
||||
#galleria_container2 {
|
||||
float: left;
|
||||
width: 38.2%;
|
||||
}
|
||||
|
||||
.info_margin {
|
||||
margin-top: 20px;
|
||||
//margin-left: 30px;
|
||||
|
||||
@ -1,114 +1,37 @@
|
||||
var map;
|
||||
var osm;
|
||||
var cycle;
|
||||
var markers;
|
||||
|
||||
// Position und Zoomstufe der Karte
|
||||
var lon = 8.6109639;
|
||||
var lat = 49.7273731;
|
||||
var zoom = 17;
|
||||
var zoom = 15;
|
||||
|
||||
var map_div = 'map';
|
||||
var map_lang = 'de';
|
||||
function drawmap(){
|
||||
map = new OpenLayers.Map(map_div);
|
||||
layer = new OpenLayers.Layer.OSM();
|
||||
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
|
||||
function drawmap() {
|
||||
OpenLayers.Lang.setCode(map_lang);
|
||||
map = new OpenLayers.Map(map_div, {
|
||||
projection: new OpenLayers.Projection("EPSG:900913"),
|
||||
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
||||
controls: [
|
||||
new OpenLayers.Control.Navigation(),
|
||||
//new OpenLayers.Control.LayerSwitcher(),
|
||||
new OpenLayers.Control.PanZoomBar(),
|
||||
],
|
||||
//maxExtent:
|
||||
// new OpenLayers.Bounds(-20037508.34,-20037508.34,
|
||||
// 20037508.34, 20037508.34),
|
||||
numZoomLevels: 18,
|
||||
maxResolution: 156543,
|
||||
units: 'meters'
|
||||
});
|
||||
|
||||
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
|
||||
var toProjection = new OpenLayers.Projection("EPSG:900913");
|
||||
var position = new OpenLayers.LonLat(lon,lat).transform( fromProjection, toProjection);
|
||||
|
||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
|
||||
osm = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
||||
cycle = new OpenLayers.Layer.OSM.CycleMap("Cycle Map");
|
||||
var size = new OpenLayers.Size(25,40);
|
||||
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
|
||||
var icon = new OpenLayers.Icon('http://meetaprogrammer.com/assets/leaflet/blue-marker-icon.png',size,offset);
|
||||
var halfIcon = icon.clone();
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("Websites", { projection: new OpenLayers.Projection("EPSG:4326"),
|
||||
visibility: true, displayInLayerSwitcher: false, hover: true });
|
||||
|
||||
map.addLayers([ osm, cycle, markers]);
|
||||
addMarker(markers, lon, lat, 1);
|
||||
jumpTo(lon, lat, zoom);
|
||||
$('#'+map_div).show();
|
||||
}
|
||||
|
||||
function jumpTo(lon, lat, zoom) {
|
||||
var x = Lon2Merc(lon);
|
||||
var y = Lat2Merc(lat);
|
||||
map.setCenter(new OpenLayers.LonLat(x, y), zoom);
|
||||
return false;
|
||||
}
|
||||
function Lon2Merc(lon) {
|
||||
return 20037508.34 * lon / 180;
|
||||
}
|
||||
|
||||
function Lat2Merc(lat) {
|
||||
var PI = 3.14159265358979323846;
|
||||
lat = Math.log(Math.tan( (90 + lat) * PI / 360)) / (PI / 180);
|
||||
return 20037508.34 * lat / 180;
|
||||
}
|
||||
|
||||
function addMarker(layer, lon, lat, projectid) {
|
||||
|
||||
var ll = new OpenLayers.LonLat(Lon2Merc(lon), Lat2Merc(lat));
|
||||
var feature = new OpenLayers.Feature(layer, ll);
|
||||
feature.closeBox = true;
|
||||
//feature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {minSize: new OpenLayers.Size(300, 180)} );
|
||||
//feature.data.popupContentHTML = popupContentHTML;
|
||||
//feature.data.overflow = "hidden";
|
||||
|
||||
var marker = new OpenLayers.Marker(ll);
|
||||
marker.feature = feature;
|
||||
|
||||
/*var markerClick = function(evt) {
|
||||
/*if (this.popup == null) {
|
||||
this.popup = this.createPopup(this.closeBox);
|
||||
map.addPopup(this.popup);
|
||||
this.popup.show();
|
||||
} else {
|
||||
this.popup.toggle();
|
||||
}
|
||||
console.log(popupStore);
|
||||
OpenLayers.Event.stop(evt);
|
||||
};*/
|
||||
|
||||
var markerHover = function(evt){
|
||||
loadPageDetails(projectid);
|
||||
showSidebar();
|
||||
}
|
||||
|
||||
//marker.events.register('featurehighlighted', null, markerHover);
|
||||
marker.events.register("mouseover", feature, markerHover);
|
||||
|
||||
layer.addMarker(marker);
|
||||
//map.addPopup(feature.createPopup(feature.closeBox));
|
||||
}
|
||||
|
||||
function getCycleTileURL(bounds) {
|
||||
var res = this.map.getResolution();
|
||||
var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
|
||||
var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
|
||||
var z = this.map.getZoom();
|
||||
var limit = Math.pow(2, z);
|
||||
|
||||
if (y < 0 || y >= limit)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = ((x % limit) + limit) % limit;
|
||||
|
||||
return this.url + z + "/" + x + "/" + y + "." + this.type;
|
||||
}
|
||||
}
|
||||
marker = new OpenLayers.Marker(position,icon.clone());
|
||||
marker.setOpacity(1);
|
||||
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); OpenLayers.Event.stop(evt); });
|
||||
markers.addMarker(marker);
|
||||
|
||||
//map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
//map.zoomToMaxExtent();
|
||||
map.setCenter(position, zoom );
|
||||
halfIcon.setOpacity(0.5);
|
||||
|
||||
$('#'+map_div).show();
|
||||
}
|
||||
@ -3,5 +3,7 @@
|
||||
class default_preise extends SYSTEM\PAGE\Page {
|
||||
public function html() {
|
||||
$text = \SYSTEM\locale::getStrings(\DBD\locale_string::CATEGORY_FRISEURTEAM_TEXT);
|
||||
return $text['default_preise'];}
|
||||
$vars = array();
|
||||
$vars['default_gallery'] = saimod_webcraft_gallery::getGalleryGalleria(2);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_preise/default_preise.tpl'), $vars);}
|
||||
}
|
||||
1
friseurteam/page/default_preise/default_preise.tpl
Normal file
1
friseurteam/page/default_preise/default_preise.tpl
Normal file
@ -0,0 +1 @@
|
||||
<div id="galleria2_container"><div id="galleria">${default_gallery}</div></div>
|
||||
Reference in New Issue
Block a user