Author Topic: Concept: Google Images in 2013 products  (Read 1986 times)

0 Members and 1 Guest are viewing this topic.

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Concept: Google Images in 2013 products
« on: April 08, 2012, 05:11:55 AM »
Since Google Earth functions are gone in Civil3D 2013 I thought it might be possible to create something ourself. But because the Google Earth API is depricated and not available in newer versions of Google Earth (as far as I know), we need another approach. There is a Javascript API and with a free API key we can use Google Maps.

A few years ago I created a web environment in PHP and used the API to create Maps with markers where company projects were done. The projects could be geo referenced and the locations were saved in the database. To show them on the map, I made it possible to do a database search for projects in a certain year and a given distance from a location. With this system it was possible for the company to see if there were projects done in the past at a certain location.

So, in .NET we might create a Form with a few buttons and a browser object. I thought, what if we communicate with the browser object to set a location. As soon as we have the map in the Form at the right location, we perform a screenshot action of the browser part and paste it into AutoCAD.

But there are some things I am not sure about if it works.

- Calling the Maps API with the API Key can only be done from a reachable web server. So you can't just create HTML on the fly in a temp map and access the API.
- Is it easy to get access to the Javascript functions to get back the location and zoomfactor, or do we need to read the DOM from the browser object.
- Is it possible to not use the API but just throw an url to the browser object to find the location in Maps and is it possible to get the zoomfactor back from the URL or the DOM without using a Key. This way we can use html on the fly or just an url instead of a reachable web server.
(- Is it allowed to use screenshots of Maps in commercial drawings)


The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Concept: Google Images in 2013 products
« Reply #1 on: April 08, 2012, 07:10:27 AM »
- Is it easy to get access to the Javascript functions to get back the location and zoomfactor, or do we need to read the DOM from the browser object.

Yes, using the 'getCenter' / 'getZoom' methods of the 'google.maps.Map' class. There are also the 'zoom_changed' and 'center_changed' Events of the Map Object.

Here is the reference that I use:

https://developers.google.com/maps/documentation/javascript/reference

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Concept: Google Images in 2013 products
« Reply #2 on: April 08, 2012, 10:21:43 AM »
- Is it easy to get access to the Javascript functions to get back the location and zoomfactor, or do we need to read the DOM from the browser object.

Yes, using the 'getCenter' / 'getZoom' methods of the 'google.maps.Map' class. There are also the 'zoom_changed' and 'center_changed' Events of the Map Object.

Here is the reference that I use:

https://developers.google.com/maps/documentation/javascript/reference



Sorry, I meant accessing javascript in .NET, or get this from the browser DOM :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.