mardi 24 mars 2015

How to Load SQL Geometry Data on OpenLayers3?


I am New in OpenLayers 3. I have to Load Geometry data from sql to my openlayers map.


This is my code :



var tileLayer = new ol.layer.Tile({
source: new ol.source.MapQuest({ layer: 'osm' })


})



var vectorLayer = new ol.layer.Vector({
source: vectorSource,
style: new ol.style.Style({
fill: new ol.style.Fill({
color: '#0099FF'
}),
stroke: new ol.style.Stroke({
color: '#0033CC',
width: 2
}),
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#0099FF'
}),
stroke: new ol.style.Stroke({
color: '#0033CC',
width: 2
})
})
}),


});



map = new ol.Map({
target: 'map', // The DOM element that will contains the map
renderer: 'canvas', // Force the renderer to be used
layers: [tileLayer, vectorLayer],
overlays: [overlay],
view: new ol.View({
center: ol.proj.transform([2, 41], 'EPSG:4326', 'EPSG:3857'),
zoom: 3
})


});


This My Code For OpenLayers3 Map. I have data with geometry field in my table. So, i want to draw on my openlayers map with this geometry fied.


This is Data in my geometry Field. 0xE6100000010CDDB5847CD0FF56C00EBE30992A583D40


so, how can i draw with this type of data?





Aucun commentaire:

Enregistrer un commentaire