0

Oracle のデータを使用して Perl から書き込まれた KML 文字列を読み取るOpenLayers マップ (ここで見つけることができます。青い検索領域を使用します) があります。KML を次のように読み取ります。

var vector_Layer = new OpenLayers.Layer.Vector("Search Results");

function GetFeaturesFromKMLString (strKML) {
    var format = new OpenLayers.Format.KML({
    'internalProjection': new OpenLayers.Projection("EPSG:900913"),
    'extranalProjection': new OpenLayers.Projection("EPSG:4326")    
    });
    return format.read(strKML);
};

vector_Layer.addFeatures(GetFeaturesFromKMLString('$newkml'));

私が見つけた問題は、すべての機能が表示されないことです。たとえば、エジンバラを検索すると、11 個のフィーチャを含む KML から最初の 3 個のフィーチャのみが表示されます。Edinburgh を検索すると生成される KML は次のようになります。

<?xml version="1.0" encoding="utf-8" ?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Folder><name>scotland_one_inch_1st</name><Schema name="scotland_one_inch_1st" id="scotland_one_inch_1st"><SimpleField name="Name" type="string"></SimpleField><SimpleField name="Description" type="string"></SimpleField><SimpleField name="SHEET" type="string"></SimpleField></Schema><Placemark><name>COLLINS, Greenvile</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">The east coast of Scotland with the isles of Orkney and Shetland</SimpleData></SchemaData><Data name="ID"><value>5728</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.7676,60.8791 .1049,60.8791 .1049,55.4382 -4.7676,55.4382</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>VAN KEULEN, Johannes</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Nieuwe pascaert van de oost cust van Schotlandt beginnende van Barwyck tot aen de Orcades ylanden</SimpleData></SchemaData><Data name="ID"><value>5972</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.1645,58.6564 -.7398,58.6564 -.7398,55.7407 -4.1645,55.7407</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>WAGHENAER, Lucas, Janszoon</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Beschrijuinge van een deel vann Schottlandt van Bambourg tot Aberdein daer Edenberg de princepaele coepstat?</SimpleData></SchemaData><Data name="ID"><value>5847</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.2504,57.1679 -1.3825,57.1679 -1.3825,55.5345 -3.2504,55.5345</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>KNOX, James</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Map of the Basin of the Firth of Forth, including the Lothians, Fife, & Kinross, with parts of the adjoining Shires</SimpleData></SchemaData><Data name="ID"><value>5464</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-4.0011,56.3508 -2.3221,56.3508 -2.3221,55.5773 -4.0011,55.5773</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>BLAEU, Joan</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Fifae Vicecomitatus, The Sherifdome of Fyfe</SimpleData></SchemaData><Data name="ID"><value>6172</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.6467,56.5955 -2.4311,56.5955 -2.4311,55.9404 -3.6467,55.9404</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>MOLL, Herman</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">The Shires of Fife and Kinros by H. Moll Geographer</SimpleData></SchemaData><Data name="ID"><value>5829</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7619,56.4995 -2.364,56.4995 -2.364,55.9376 -3.7619,55.9376</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>BLAEU, Joan and Cornelis</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Lothian and Linlitquo</SimpleData></SchemaData><Data name="ID"><value>5824</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.737,56.143 -2.405,56.143 -2.405,55.7104 -3.737,55.7104</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>COLLINS, Greenvile</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Edinburgh Firth</SimpleData></SchemaData><Data name="ID"><value>5974</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4581,56.3983 -2.4148,56.3983 -2.4148,55.8581 -3.4581,55.8581</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>THOMSON, John</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Northern part of Edinburgh Shire [2 separate sh.]</SimpleData></SchemaData><Data name="ID"><value>5501</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7407,55.9899 -2.8252,55.9899 -2.8252,55.6441 -3.7407,55.6441</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>ADAIR, John</name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">A map of Mid-Lothian, survey%27d by Mr J. Adair F.R.S.</SimpleData></SchemaData><Data name="ID"><value>5469</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.7407,55.9899 -2.8252,55.9899 -2.8252,55.6441 -3.7407,55.6441</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name></name><ExtendedData><SchemaData schemaUrl="scotland_one_inch_1st"><SimpleData name="SHEET">Firth of Forth - Fisherrow to Edgar</SimpleData></SchemaData><Data name="ID"><value>156</value></Data></ExtendedData><Polygon><outerBoundaryIs><LinearRing><coordinates>-3.4441,56.0993 -3.0092,56.0993 -3.0092,55.9221 -3.4441,55.9221</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark></Folder></Document></kml>

以前にこのような問題が発生したことがありますか?それが KML の問題なのか OpenLayers の問題なのか知っていますか?

4

1 に答える 1