
Hab da ein paar Fragen zu deinem Overlay Aufbau.
gruesse aus EDDC VRS ^^
Code: Select all
<?php
/**outtojson
* @version 0.01
*/
header("Content-Type: text/plain;charset=utf-8");
$airport="eddb";//array identifier var eddb0 ... var eddb1 ...
$outstring=file_get_contents("eddb.out");//outline file name
$outstring=preg_replace(['(#.+)','({.+)','(;.+)','(//.+)','(\$TYPE.+)'],'',$outstring);//remove comments and "$TYPE?"
$outstring=trim($outstring,"\t\n\r\0\x0B-1");//remove -1 and more from beginning and end
$outstringarr=explode("-1",$outstring);//split individual areas
$i=0;
$jsstring="";
while(each($outstringarr)){
$jsstring.="\t\t\t\tvar $airport$i=[\r\n";
$outstringarr[$i]=preg_split("/[\s]+/",trim($outstringarr[$i]));
$j=0;
while(each($outstringarr[$i])){
if((count($outstringarr[$i])-1)==$j)$km="";else$km=",";
$jsstring.="\t\t\t\t\t{lat:".str_replace("+",",lng:",$outstringarr[$i][$j])."}$km\n";
$j++;
}
$jsstring.=" ];
pageSettings.mapPlugin.addPolyline('$airport$i', {
clickable: false,
draggable: false,
editable: false,
geodesic: true,
strokeColour: '#808080',
strokeWeight: 1,
path: $airport$i
});\n";
$i++;
}
echo $jsstring;
?>
Code: Select all
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
// Hook the event that is raised after the page has finished initialising.
bootStrap.hookInitialised(function(pageSettings) {
// Check that there's a map on the page
if(pageSettings.mapPlugin) {
// Declare each point in the line that we're going to draw. Note that the
// last entry must not have a comma after it.
Code: Select all
var eddb0=[
{lat:52.39107,lng:13.52255},
{lat:52.39163,lng:13.52389},
{lat:52.39144,lng:13.52409},
{lat:52.39089,lng:13.52276},
{lat:52.39107,lng:13.52256}
];
pageSettings.mapPlugin.addPolyline('eddb0', {
clickable: false,
draggable: false,
editable: false,
geodesic: true,
strokeColour: '#808080',
strokeWeight: 1,
path: eddb0
});
var eddb1=[
{lat:52.39061,lng:13.52044},
{lat:52.39020,lng:13.52069},
{lat:52.38988,lng:13.51938},
{lat:52.38999,lng:13.51930},
{lat:52.39002,lng:13.51940},
{lat:52.39032,lng:13.51922},
{lat:52.39060,lng:13.52044}
];
pageSettings.mapPlugin.addPolyline('eddb1', {
clickable: false,
draggable: false,
editable: false,
geodesic: true,
strokeColour: '#808080',
strokeWeight: 1,
path: eddb1
});
Code: Select all
}
}, this);
});
}