javascript - UTM and GeoJson in openlayers -


i want implement example http://api.geoext.org/1.1/examples/feature-grid.html made of geoext , openlayers, feature grid populated of geojson file

in development have geojson file utm format, single feature of file (the coordinates utm)

{"geometry": {"type": "point", "coordinates": [7535169.36, 402844.172]}, "type": "feature", "properties": {"nombre": "la victoria", "codigo": "1702"}, "id": "1702"} 

i tried show points in code, can't see anything, code

// create feature store, binding vector layer             store = new geoext.data.featurestore({                 layer: vecciudades,                 fields: [                     { name: 'nombre' },                     { name: 'codigo' }                 ],                 proxy: new geoext.data.protocolproxy({                     protocol: new openlayers.protocol.http({                         url: "data/summits.json",                         format: new openlayers.format.geojson({                             ignoreextradims: true,                             internalprojection: new openlayers.projection("epsg:900913"),                             externalprojection: new openlayers.projection("epsg:4326")                         })                     })                 }),                 autoload: true             }); 

as can see, tried specify internal , external projection of feature store, implementation looks example of link mentioned above, when select city map located wrong place (the place shown near south pole, has near south america)

thanks in advance

for reason featurestore..? define layer following:

var vecciudades = new openlayers.layer.vector('mylayer', {     strategies:[new openlayers.strategy.bbox()],     isbaselayer:false,     projection:new openlayers.projection("epsg:900913"),     stylemap:new openlayers.stylemap(null),     transitioneffect:'resize',     protocol:new openlayers.protocol.http({         url: "data/summits.json",         format:new openlayers.format.geojson({             ignoreextradims:true         }),         readwithpost:false,         updatewithpost:false,         srsinbbox:true     }) }); 

also register following event on map:

map.events.register("moveend", this, function (e) {     vecciudades.refresh({force:true}); }); 

that reread geojson anytime moved or zoomed map , request contain bounding box of visible area can send features going visible not of them.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -