[OpenLayers-Users] Problem with polygon layer

boesiii boesiii at yahoo.com
Mon Jun 17 11:38:41 PDT 2013


I can not get a polygon layer to display in my map.  I know my projection is
correct.  I am able to see the feature collection in the Chrome developer
tools.  I am trying to display the features on a Bing background map.  I am
able to display other layers types (points and lines) but not polygons.

html content:

var polygon_layer = new OpenLayers.Layer.Vector("Polygon Test", {
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "zoning_3857.geojson",
        format: new OpenLayers.Format.GeoJSON()
    })
});

geojson content:

{
"type": "FeatureCollection",
                                                                                
"features": [
{ "type": "Feature", "id": 0, "properties": { "FID_": 0, "DISTRICT": "I-P"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [
-8932954.1129319537, 4964325.5273277452, 0.0 ], [ -8932531.1661052275,
4964545.5679499609, 0.0 ], [ -8932564.2756628711, 4964648.5912505277, 0.0 ],
[ -8932119.2363246344, 4964545.5571182314, 0.0 ], [ -8931528.9700285774,
4964487.325728449, 0.0 ], [ -8931336.3762620818, 4964199.3962222449, 0.0 ],
[ -8932442.9025431275, 4963813.8519779891, 0.0 ], [ -8932695.6374064647,
4963748.4562525228, 0.0 ], [ -8932622.0071035624, 4963593.6319049932, 0.0 ],
[ -8932571.2488040607, 4963455.4847083865, 0.0 ], [ -8932533.953082405,
4963327.2427689005, 0.0 ], [ -8932476.1276511848, 4963109.4153856169, 0.0 ],
[ -8932462.5047901142, 4963052.8698634924, 0.0 ], [ -8932332.0144203007,
4962599.8741752226, 0.0 ], [ -8932205.987532232, 4962247.6652926989, 0.0 ],
[ -8932140.6225657687, 4962086.8180426667, 0.0 ], [ -8932040.3750305306,
4961819.3252690295, 0.0 ], [ -8932351.1062503401, 4961577.2089594249, 0.0 ],
[ -8932388.3864320945, 4961646.9301211396, 0.0 ], [ -8932428.9463316146,
4961719.0770707512, 0.0 ], [ -8932445.2857452761, 4961743.4701831499, 0.0 ],
[ -8932504.4656521156, 4961849.7049322566, 0.0 ], [ -8932578.1289786417,
4961971.3581229802, 0.0 ], [ -8932673.7713223342, 4962103.7472769916, 0.0 ],
[ -8932761.629673956, 4962230.4523006463, 0.0 ], [ -8932820.0733877718,
4962324.5722710583, 0.0 ], [ -8932861.0867185369, 4962398.3592753289, 0.0 ],
[ -8932889.5089857262, 4962452.6327848025, 0.0 ], [ -8932906.0994726401,
4962485.8599135, 0.0 ], [ -8932931.4786009323, 4962517.5784442965, 0.0 ], [
-8932969.4782509003, 4962584.072623333, 0.0 ], [ -8933025.4423943721,
4962661.2773896055, 0.0 ], [ -8933088.9131869171, 4962762.6745449798, 0.0 ],
[ -8933147.7731196173, 4962871.3436343847, 0.0 ], [ -8933185.6695730854,
4962948.3199340887, 0.0 ], [ -8933215.5961415991, 4963013.1186691569, 0.0 ],
[ -8933248.6987711154, 4963090.8868960068, 0.0 ], [ -8933264.4651883338,
4963123.2826713044, 0.0 ], [ -8933278.3306363001, 4963145.2043670202, 0.0 ],
[ -8933310.2738617845, 4963181.8253754005, 0.0 ], [ -8933340.307456838,
4963236.1317564221, 0.0 ], [ -8933349.5134761967, 4963263.639089169, 0.0 ],
[ -8933367.5168605875, 4963289.9267230369, 0.0 ], [ -8933370.0314775836,
4963293.6837310679, 0.0 ], [ -8933385.7138197497, 4963308.8415646637, 0.0 ],
[ -8933403.8547637891, 4963325.7681913972, 0.0 ], [ -8933411.9599065389,
4963342.7030615872, 0.0 ], [ -8933423.2321705632, 4963358.0618480602, 0.0 ],
[ -8933441.4201316964, 4963376.6495391596, 0.0 ], [ -8933450.0628359634,
4963398.4052153574, 0.0 ], [ -8933459.8422061428, 4963417.7609672034, 0.0 ],
[ -8933482.1129744276, 4963438.7639810303, 0.0 ], [ -8933531.0252934005,
4963479.1596051985, 0.0 ], [ -8933586.1509236749, 4963540.5489417613, 0.0 ],
[ -8933623.0123673193, 4963609.0950962072, 0.0 ], [ -8933677.0944579784,
4963718.7880894914, 0.0 ], [ -8933719.3978707418, 4963823.6157750171, 0.0 ],
[ -8933746.7863533385, 4963940.481093199, 0.0 ], [ -8933764.1518904623,
4964043.6025653146, 0.0 ], [ -8933774.1537568048, 4964141.8589993091, 0.0 ],
[ -8933769.6645247713, 4964252.9852789463, 0.0 ], [ -8933768.7736053262,
4964335.1551066376, 0.0 ], [ -8933757.8515491355, 4964431.7554928754, 0.0 ],
[ -8933746.3829562161, 4964509.0134329777, 0.0 ], [ -8933742.7789766174,
4964566.2104554297, 0.0 ], [ -8933740.1069267429, 4964656.4064658368, 0.0 ],
[ -8933734.2211489342, 4964703.8951628022, 0.0 ], [ -8933734.0637018234,
4964783.5928901276, 0.0 ], [ -8933599.5440389663, 4964773.4514892967, 0.0 ],
[ -8933110.401698323, 4964692.8250366589, 0.0 ], [ -8932954.1129319537,
4964325.5273277452, 0.0 ] ] ] } }
,
{ "type": "Feature", "id": 1, "properties": { "FID_": 0, "DISTRICT": "R-1"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [
-8931336.3762620818, 4964199.3962222449, 0.0 ], [ -8930568.151045,
4962844.8137797434, 0.0 ], [ -8931545.246633796, 4962398.0791371567, 0.0 ],
[ -8931650.1739929393, 4962620.1339216484, 0.0 ], [ -8931707.3009774014,
4962550.8006979497, 0.0 ], [ -8931792.0971152112, 4962505.2336498844, 0.0 ],
[ -8931906.0986665636, 4962707.2911786009, 0.0 ], [ -8931977.726603087,
4962674.7747649141, 0.0 ], [ -8932108.3813151848, 4963101.0487198299, 0.0 ],
[ -8932134.263792783, 4963088.6527044429, 0.0 ], [ -8932205.50318777,
4963393.542398328, 0.0 ], [ -8932315.1848824527, 4963412.3358444767, 0.0 ],
[ -8932442.9025431275, 4963813.8519779891, 0.0 ], [ -8931336.3762620818,
4964199.3962222449, 0.0 ] ] ] } }
,
{ "type": "Feature", "id": 2, "properties": { "FID_": 0, "DISTRICT": "C-1"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [
-8932240.3396454211, 4962917.0986108314, 0.0 ], [ -8932214.4376542997,
4962829.1806375673, 0.0 ], [ -8932193.1115368027, 4962764.4269864485, 0.0 ],
[ -8932136.9933930151, 4962587.2921166187, 0.0 ], [ -8932121.5873983111,
4962594.6017094264, 0.0 ], [ -8932041.9705241807, 4962440.705685351, 0.0 ],
[ -8932013.1574947741, 4962389.2371508768, 0.0 ], [ -8931982.6974890046,
4962332.5711713862, 0.0 ], [ -8931949.6763498913, 4962268.780754975, 0.0 ],
[ -8931735.5342638418, 4962383.6933011282, 0.0 ], [ -8931685.243299162,
4962285.4699873077, 0.0 ], [ -8932029.9976581801, 4962080.0282878978, 0.0 ],
[ -8931962.8934271671, 4961963.0323972348, 0.0 ], [ -8931962.9200566523,
4961874.5862562479, 0.0 ], [ -8932040.3750305306, 4961819.3252690295, 0.0 ],
[ -8932140.6225657687, 4962086.8180426667, 0.0 ], [ -8932205.987532232,
4962247.6652926989, 0.0 ], [ -8932332.0144203007, 4962599.8741752226, 0.0 ],
[ -8932462.5047901142, 4963052.8698634924, 0.0 ], [ -8932351.9173643403,
4963109.7806053571, 0.0 ], [ -8932298.7459979281, 4963010.1559811262, 0.0 ],
[ -8932276.4095959403, 4963020.5726545239, 0.0 ], [ -8932240.3396454211,
4962917.0986108314, 0.0 ] ] ] } }
,
{ "type": "Feature", "id": 3, "properties": { "FID_": 0, "DISTRICT": "R-2"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [
-8932108.3813151848, 4963101.0487198299, 0.0 ], [ -8931977.726603087,
4962674.7747649141, 0.0 ], [ -8931906.0986665636, 4962707.2911786009, 0.0 ],
[ -8931792.0971152112, 4962505.2336498844, 0.0 ], [ -8931707.3009774014,
4962550.8006979497, 0.0 ], [ -8931650.1739929393, 4962620.1339216484, 0.0 ],
[ -8931545.246633796, 4962398.0791371567, 0.0 ], [ -8931685.243299162,
4962285.4699873077, 0.0 ], [ -8931735.5342638418, 4962383.6933011282, 0.0 ],
[ -8931949.6763498913, 4962268.780754975, 0.0 ], [ -8931982.6974890046,
4962332.5711713862, 0.0 ], [ -8932013.1574947741, 4962389.2371508768, 0.0 ],
[ -8932041.9705241807, 4962440.705685351, 0.0 ], [ -8932121.5873983111,
4962594.6017094264, 0.0 ], [ -8932136.9933930151, 4962587.2921166187, 0.0 ],
[ -8932193.1115368027, 4962764.4269864485, 0.0 ], [ -8932214.4376542997,
4962829.1806375673, 0.0 ], [ -8932240.3396454211, 4962917.0986108314, 0.0 ],
[ -8932276.4095959403, 4963020.5726545239, 0.0 ], [ -8932134.263792783,
4963088.6527044429, 0.0 ], [ -8932108.3813151848, 4963101.0487198299, 0.0 ]
] ] } }
,
{ "type": "Feature", "id": 4, "properties": { "FID_": 0, "DISTRICT": "C-2"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [
-8931375.5189319532, 4962992.5467488654, 0.0 ], [ -8931463.3895191941,
4963180.8242137646, 0.0 ], [ -8931268.1153344028, 4963288.9310054313, 0.0 ],
[ -8931163.5162657313, 4963104.5032791253, 0.0 ], [ -8931375.5189319532,
4962992.5467488654, 0.0 ] ] ] } }
,
{ "type": "Feature", "id": 5, "properties": { "FID_": 0, "DISTRICT": "R-3"
}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -8932205.50318777,
4963393.542398328, 0.0 ], [ -8932134.263792783, 4963088.6527044429, 0.0 ], [
-8932276.4095959403, 4963020.5726545239, 0.0 ], [ -8932298.7459979281,
4963010.1559811262, 0.0 ], [ -8932351.9173643403, 4963109.7806053571, 0.0 ],
[ -8932462.5047901142, 4963052.8698634924, 0.0 ], [ -8932476.1276511848,
4963109.4153856169, 0.0 ], [ -8932533.953082405, 4963327.2427689005, 0.0 ],
[ -8932571.2488040607, 4963455.4847083865, 0.0 ], [ -8932622.0071035624,
4963593.6319049932, 0.0 ], [ -8932695.6374064647, 4963748.4562525228, 0.0 ],
[ -8932442.9025431275, 4963813.8519779891, 0.0 ], [ -8932315.1848824527,
4963412.3358444767, 0.0 ], [ -8932205.50318777, 4963393.542398328, 0.0 ] ] ]
} }

]
}



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problem-with-polygon-layer-tp5060684.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list