Need guidance to put pin on my geo location :
Link :- http://camsphere.canopussystems.com/cesium-google-earth-examples-master/demos/geolocation/
Need guidance to put pin on my geo location :
Link :- http://camsphere.canopussystems.com/cesium-google-earth-examples-master/demos/geolocation/
You can add a billboard to the fly method. See sample below.
Really you can pretty much any sort of geometry at the location. Check out the entity documentation for more options.
var viewer = new Cesium.Viewer('cesiumContainer');
function fly(position) {
var source = new Cesium.CustomDataSource();
viewer.dataSources.add(source);
var entity = source.entities.add({
position : Cesium.Cartesian3.fromDegrees(position.coords.longitude, position.coords.latitude),
ellipse : {
semiMajorAxis : 100.0,
semiMinorAxis : 100.0,
material : new Cesium.ColorMaterialProperty(new Cesium.Color(0.2, 0.2, 1.0, 0.5))
},
billboard : {
image : '../images/whiteShapes.png',
imageSubRegion : new Cesium.BoundingRectangle(49, 43, 18, 18),
color : Cesium.Color.LIME
},
label : {
text: 'You are here',
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
show: false
}
});
function showLabel() {
entity.label.show = true;
}
viewer.camera.flyTo({
destination : Cesium.Cartesian3.fromDegrees(position.coords.longitude, position.coords.latitude, 1005.0),
complete: showLabel
});
}
// Ask browser for location, and fly there.
navigator.geolocation.getCurrentPosition(fly);
``
Hi Mike LP,
Thanks for the updates. It is working for me… Now can you guide me how can i store my location and other users who will open this link.
That is a much more complicated issue. Your going to need to decide on a server setup to store that data and then build a web service to return it to your application. Do you have a web developer that you can consult with?