Reading latitude and longitude from database with Oracle ADF - javascript

Using Google Maps api v3, I am trying to reconstruct polylines (and other shapes) on a map when my (.jsf) page loads. The points of the polyline are stored in an Oracle database. I have tried passing both a XML and a JSON file to some javascript code that will generate the points on the map. However, Oracle ADF does not open the file but instead opens a 'loopback script'.
Is there a particular configuration that needs to be set in order to achieve this? Or am I going about this all wrong? Is there an alternative way to reconstruct the shapes on a map from the database using Oracle ADF?
I will be grateful for any guidance or direction.

you are using oracle adf's MAP component or google map,
see this ,hope it will help
https://blogs.oracle.com/middleware/entry/integrating_google_maps_with_adf

Related

Use Google Spreadsheet as data source for Chart.js

Is it possible to use a Google spreadsheet as a datasource when using Chart.js?
I'd like to use Chart.js to create a line chart with multiple lines, and I'd like the user to be able to view all lines at once or select certain ones to display. Seems fairly simple to do with Chart.js, however, I'm wondering how to make the chart updatable for the client.
The client already has a dataset in Google spreadsheet that they update regularly, so I'd like to have the chart on the website update along with the spreadsheet.
Would I just need to export the Google spreadsheet as a JSON file?
yes you can.
https://developers.google.com/sheets/api/v3/data you can retrieve google spreadsheet data using API and present the returned data in Chart.js.

Does Google Map offer REST api service?

What I want to do is to load a map with predefined markers on it. I could write code in map initialization to do this. I wonder if google offer REST api that I call it instead of coding to load the map and its predefined markers?
Of course there is! heres a link to their JS api: https://developers.google.com/maps/documentation/javascript/
Read till the bottom, there's a small example.

Incorporating polygons into Google Maps API 3

Part of my web application will allow users to click on a certain territory of a map and have it highlight that section in the Google Maps that I have on the page. This is pretty standard on a lot of websites, but I'm having a hard time with the amount of data that's there.
I'm trying to generate data from http://global.mapit.mysociety.org/, which provides me several output options for actual coordinates that I want to turn into polygons, but exporting the WKT, GeoJSON, or the KML is HUGE - 700-900 KB for EACH instance, and I don't understand how this website is able to incorporate these polygons without loading this data, (Chrome doesn't show any item over 50 KB being loaded.)
What I'm doing NOW:
I downloaded a few of the WKT files, then used PHP to translate that into a javascript string so :
var coordinates = [
new google.maps.LatLng(1.1, 1.2),
...
new google.maps.LatLng(1.1, 1.2)
];
I did this with about 10 locations, saved my file, and it was 9 MB - all from these super long coordinates strings...
How do I do this more efficiently, as this is obviously not the way to incorporate polygon data into a dynamic map load?
Don't translate it on serverside, the string new google.maps.LatLng will blow up your file.
When you use e.g. geoJSON you may load the polygon via loadGeoJson.
The linked page uses geoJSON to draw the polygons(e.g. http://global.mapit.mysociety.org/area/686972.html loads these data: http://global.mapit.mysociety.org/area/686972.geojson?simplify_tolerance=0.0001 ~100KB)
Another option would be to encode each single polygon(polyline) on serverside and reassemble/decode the polygons via JS.
See https://developers.google.com/maps/documentation/utilities/polylinealgorithm and https://developers.google.com/maps/documentation/javascript/reference#encoding for more details.

Google Maps API: how do I make user-added markers permanent?

I am currently trying to create a map application which allows users to add their own pins. I want it to be an 'open' map where anyone with an account can add/edit pins on top of everyone else's.
With my limited knowledge of JavaScript, I have got to the point where anyone can add their pins, but they don't save (i.e. are removed once the application is reloaded). Only those I have put in manually (in the script) actually stick.
So, could anyone help me out?
How can I create some sort of 'database' (like in the custom map editor for google maps) which users can edit without having to actually put it in the code?
look at jStorage http://www.jstorage.info/
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="jstorage.js"></script>
<script>
// Check if "key" exists in the storage
var value = $.jStorage.get("key");
if(!value){
// if not - load the data from the server
value = load_data_from_server()
// and save it
$.jStorage.set("key",value);
}
</script>
Have two arrays saved by jStorage, lat and lng arrays, and then set markers by using a for loop and let it work through the arrays.

How do I get traffic control for my Google Map object?

I have set my Google Map object to view as a ROADMAP, but there is no traffic options like there is on the regular Google Maps. Below is the control I am trying to get. Is this possible via the map options in the API? I tried looking in the docs but there is nothing there for that (unless I am missing something).
You can create a custom control as shown on this example from the documentation.
Here is an example that shows embedding a traffic control onto the map.
http://pietervogelaar.nl/google-maps-api-v3-traffic-toggle-button/

Categories