This is a discussion on How to include Google earth in winforms of c# application within the C# Programming forums, part of the Software Development category; hi all, i am trying to include google earth in my application, it works fine in asp.net where i ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hi all, i am trying to include google earth in my application, it works fine in asp.net where i used javascript to include it. but in case of winforms(windows application), i had created user controls for google earth map, and used that control in my form, but while i running my application it parallely starting the googleearthplus application also, and also display the same in my form also, if i closed the googleearthplus application, control in my form also get disappear.. is any other way yo include the google earth in our winforms or any other solution for this? Thanks Manivannan.s |
| Sponsored Links |
| |||
| hi friends, i had find the way to include google map in my winform add webbrowser control to form then in load event webBrowser1.Navigate("http://maps.google.com/maps"); add this code if u know any functionality to add marker, mapping places..etc in google map post here.. its helpful for me Thanks Manivannan.s |
| |||
| hi, yes, but we need to create one own website, in that we need to integrate the google map using javascript, for that we need to signup in google to get API key, here is the example code to include google map in our site: <script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAeN_LhMOi4FsadGt6q2yJ qRRi-exo-90g1z9p2Z9OroAhcfs0axTr-W4zx9cE4tcCyp6mf1TJ2QiIAA" type="text/javascript"></script> <script type="text/javascript"> function load() { if (GBrowserIsCompatible()) { var map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(51.179045, -1.826752), 14); var point = new GLatLng(51.17904, -1.826752); var marker = new GMarker(point); map.addOverlay(marker); } } //]]> </script> <html> <body> <div id="map" style="width: 900px; height: 500px;"></div> </body> </html> it will help you to create your own google map for ur site, after that create a windows application, split the windows as per ur requirement, add webbrowser to it, and onloading of form give webbrowser1.navigate("http://")//ur site url Regards Manivannan.s |
| |||
| hi is it possible to change the marker image over the map, any idea? |
| |||
| Quote:
hi check this link it helps u.. Google Earth COM API Documentation |
| |||
| Quote:
Quote:
var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-92.27722, 34.74875), 4); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var point = new GPoint(-92.27722, 34.74875); var blueIcon = new GIcon(); blueIcon.iconAnchor = new GPoint(9, 34); blueIcon.image = "http://localhost:1661/map/Arrow.gif"; blueIcon.iconSize = new GSize(20, 34); blueIcon.infoWindowAnchor = new GPoint(9, 2); var Icons=[]; Icons[0] = blueIcon; var marker = new GMarker(point,Icons[0]); map.addOverlay(marker); give HTTP url to the image icon Regards Manivannan.s |
| |||
| hi, how to retrieve the longitude and latitude of the position onclick? |
| |||
| Quote:
<script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(51.179045, -1.826752), 14); var point = new GLatLng(51.17904, -1.826752); var marker = new GMarker(point); map.addOverlay(marker); GEvent.addListener(map, 'click', function(overlay, point) { if (overlay) { map.removeOverlay(overlay); } else if (point) { map.recenterOrPanToLatLng(point); var marker = new GMarker(point); map.addOverlay(marker); document.getElementById("latbox").value=point.y; document.getElementById("lonbox").value=point.x; } }); } } //]]> </script> <body onload="load()" bgcolor="gray" onunload="GUnload()"> <div align="center" style="vertical-align:middle;"> <div id="map" style="width: 900px; height: 500px;"></div> <table align="center"> <TR><TD ALIGN="left"> Lat: </TD><TD><INPUT SIZE=13 TYPE="TEXT" ID="latbox" NAME="lat" value="" ></TD></TR> <TR><TD ALIGN="left">Lon: </TD><TD><INPUT SIZE=13 TYPE="TEXT" ID="lonbox" NAME="lon" value="" ></TD></TR> </table> </div> </body> Regards Manivannan.s |
| |||
| hi, The above code helps to remove the marker from map, i am searching for it for a long time, thanks but i am facing a problem with icon, Quote:
Thank you G.Devaki |
| |||
| Quote:
<script type="text/javascript"> //<![CDATA[ var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-92.27722, 34.74875), 4); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var point = new GPoint(-92.27722, 34.74875); var blueIcon = new GIcon(); blueIcon.iconAnchor = new GPoint(9, 34); blueIcon.image = "http://localhost:1661/map/Arrow.gif"; blueIcon.iconSize = new GSize(20, 34); blueIcon.infoWindowAnchor = new GPoint(9, 2); var Icons=[]; Icons[0] = blueIcon; var marker = new GMarker(point,Icons[0]); map.addOverlay(marker); GEvent.addListener(map, 'click', function(overlay, point) { if (overlay) { map.removeOverlay(overlay); } else if (point) { map.recenterOrPanToLatLng(point); document.getElementById("latbox").value=point.y; document.getElementById("lonbox").value=point.x; var marker = new GMarker(point,Icons[0]); map.addOverlay(marker); } }); </script> Regards Manivannan.s |
| |||
| hi i am trying to place my marker over google map based on my values(longitude,latitude) from database have any idea to implement this? |
| |||
| hi, i have created xml file using my database data's here is the sample <markers> <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window" label="Marker Two" /> <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window" label="Marker Three" /> </markers how can i integrate my xml file to google map? |
| |||
| hi, some issue with mapping: There are several limitations to the Maps API: * It doesn't provide a geocoding service; that is, you have to provide it with longitude and latitude. This means you need to rely on third-party geocoding tools to get longitude and latitude for an address. * It doesn't include a routing or driving directions service. * The Google Maps API key is restricted to generate maps only for URLs (website or a local host). You need to have a web server even for development. * The key you receive is only valid for a single directory on your web site. * It can be used for commercial purposes, but it should be available to end users for free. * It can be used on a site that is password protected, but consumers should be able to sign up for a password without charge. * Usage is not necessarily restricted, but if your site is getting more than 50,000 hits per day, you'd better contact Google. |
| |||
| Hi Mani, Is there any way to integrate any third party reporting tools to google map windows application for showing out some sort of statistical report?
__________________ H2O Without us, no one can survive.. |
| |||
| yes H2O, I was also having the same query to be asked to Mani. But my second question was to show up 3D Modelling sort of reports. I think Mani can answer to me as well. Thanks in advance.
__________________ G.A.P |
| |||
| Quote:
hi, here is the sample code to draw polygon, // ***** Use SVG to draw and fill polygons _mSvgEnabled = true; _mSvgForced = true; //Load map var map = new GMap(document.getElementById("map")); var lineThickness = 1; var points2 = []; var polygons = new Array(); map.setCenter(new GLatLng(47.6719664015333, -122.4019448761567), 6);//11); getPoints(); Gpolygons = new GPolygon(points ,"#698b22", 2, 0.7,"#b3ee3a", 0.5) ; map.addOverlay(Gpolygons) ; function getPoints() { points2.push(new GLatLng(47.67207767885599, -122.40447521209717)); points2.push(new GLatLng(47.67047381359744, -122.40391731262207)); points2.push(new GLatLng(47.67051716195521, -122.40129947662353)); points2.push(new GLatLng(47.67204878081891, -122.40127801895141)); } use all other's necessary code from above post Regards Manivannan.s |