(07-02-2012, 14:51)Odoakr napisał(a): Nie łączysz się z bazą.
masz:
mysql_select_db("gis");
powinno być:
$ db = mysql_select_db("gis", $con);
Zmieniłem i bez zmian.
Ok Doszedłem do tego żeby tworzyło. Teraz w wyniku otwymuje:
Kod:
{"type":"FeatureCollection","features":[{"type":"Feature","nr_zlecenia":"nr_zlecenia_domyslny","GPSImgDirection":"45","opis":"opis_domyslny","path":"foto/2012-02-06_P1000023.JPG","geometry":{"type":"Point","coordinates":"[50.928019444444,21.369808333333]"}},{"type":"Feature","nr_zlecenia":"nr_zlecenia_domyslny","GPSImgDirection":"315","opis":"opis_domyslny","path":"foto/2012-02-06_P1000022.JPG","geometry":{"type":"Point","coordinates":"[50.928019444444,21.369808333333]"}}]}
Jak dodaje za pomocą kodu :
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}
),
[b]new OpenLayers.Layer.Vector("geojson", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "./new.php",
format: new OpenLayers.Format.GeoJSON()
}),
// parametry opcjonalne
displayInLayerSwitcher: true,
minScale: 3000000,
maxScale: 50000
})[/b]
],
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);
}
To w LayerSwitcher pojawia sie warstwa zaciemniona, zaznaczona ale nie moge jej odchaczyc ani zaznaczyc. Również nie pojawiają sie punkty