Here maps autocomplete js api - javascript

Here maps added autocomplete function to its geocoder api
http://autocomplete.geocoder.cit.api.here.com/6.2/suggest.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&query=Pariser+1+Berl
&beginHighlight=<b>
&endHighlight=</b>
It is complete new and not well documented right now. I do not know how to call it with js api. Do anybody use it with the js api or know how to use it with js api?
Most js api acts as wrapper class for geocorder, so i want to prefer using existing wrapper before building my own.

There is now a project to wrap the HERE Maps JS API, you can find it on NPM here:
https://www.npmjs.com/package/node-heremaps
If you're looking to display maps in the browser, I've started working on a project for a React integration here:
https://www.npmjs.com/package/react-here-maps
And you can of course just include the HERE Maps script directly.

The HERE Maps JS API doesn't seem to have an existing wrapper for it (yet?). Easiest thing would probably be to call the URL via jQuery ($.get) or some such until it's integrated. The JS API doesn't do much more than create a JSON-P request and hand you the result back...

https://developer.here.com/api-explorer/rest/geocoding_suggestions/geocoding-autocomplete
Refer To This Link For Further Demo and Implementation

For a full working example see fiddle at https://jsfiddle.net/Lhj2mnpd/.
https://autocomplete.geocoder.cit.api.here.com/6.2/suggest.json?query=1+Main+Street&app_id=hereid&app_code=herecode&beginHighlight=%3Cb%3E&endHighlight=%3C%2Fb%3E

Moving forward with your code
Just Replace
your purchased api key and code like
http://autocomplete.geocoder.cit.api.here.com/6.2/suggest.json?app_id={"purchasedappid here "}&app_code={"purchased appcode here "}&query=Pariser+1+Berl&beginHighlight=&endHighlight=`

Related

Can you use Google API to search for addresses without widget?

I see https://developers.google.com/maps/documentation/javascript/places-autocomplete, but don't see a way to just use their API to find those results with a custom widget. I see they have APIs without widgets, like places ("Joe's Pizza Shop"), but don't see the same for addresses which is hard to believe.
I want to use my existing autocomplete to avoid having a set of CSS for the usual autocomplete and then another set for this widget, and to avoid JSONP.
So is there no such API for addresses or am I missing something obvious?
Yes, there is an API for that: https://developers.google.com/maps/documentation/javascript/places-autocomplete#place_autocomplete_service
You can use AutocompleteService.getPlacePredictions to get the same predictions as you'd get via the Autocomplete widget, and use it to implement your own UI.

Can't get Angular UI-Map working

This should be simple but I'm fairly new to Angular and really can't understand the documentation for UI-Map form the Angular UI team.
https://github.com/angular-ui/ui-map
There are a few things I don't understand so it's probably easier for me to number them.
1) The docs talk about using Bower to install which I don't use. It says I have to load UI-map and UI-event but I'm loading Angular UI from cdnjs.com, So I think that bundles all the directives I need, or am I wrong?
2) The docs say that I have to listen to the callback parameter when loading the Google Maps API using the following code..
function onGoogleReady() {
angular.bootstrap(document.getElementById("map"), ['app.ui-map']);
}
But I don't know what this is doing or where it is being called? Does google call this automatically when it's ready? Why is it attaching the map to an element with ID "map", surely I need to be able to dynamically use the map on many elements using the directive?
To add to the confusion, their own demo calls the function "initCall", instead of "onGoogleReady".
3) The docs say I have to add it as a dependency on my app module.
var myAppModule = angular.module('app.ui-map', ['ui.map']);
What is the app. before ui-map? My current app declaration looks like this and only has dependencies named in the array...
var portal = angular.module('portal', ['ngAnimate','ui.router', 'ui.bootstrap', 'restangular'])
Maybe I'm being really stupid, but I added 'ui-map' into the array but it didn't seem to work :(
I know this might seem easy to some but as I said I'm new to Angular and still don't totally get how dependency injection works or what order things are loaded/initialized in. Any help would really be appreciated.
It doesn't look like Angular UI maps is supported any more (I might be wrong), so I used Angular Google Maps instead.
http://angular-google-maps.org/

JavaScript: Using OmniGrid with loadData

I'm trying to work with the nice OmniGrid control.
Everything is great when I'm setting a URL for an ASP.NET handler that returns an answer.
My problem starts when I'm trying to use the data provider.
I was breaking my fingers trying to find a piece of information of how to use the data provider (can't find the appropriate format of the table content result).
Anyone familiar with such tutorial/example?
My I know how you are trying to integrate it in your pages? and what kind of backed u have to bind?

Upgrading Google Maps javascript v2 to v3 using Business Client IDs

I am using this link for Upgrading Google Maps JavaScript Application v2 To v3. Basically my approach is to get the output from api, parse it and load it using MapKit framework, which i am succeeded in doing it using this code.
My problem : As per the documentation,if we are using google maps for Business customer, we will need to use a Client ID in place of a Key.
so if I use this code:
<script src="https://maps.googleapis.com/maps/api/js?v=3&client=gme-myclientId&sensor=false" type="text/javascript"></script>
i am getting following output, where all the locations are plotted at single point (probably centre) :
if i use this code:
<script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
i will get the expected (correct) output as follows:
I also ran through this documentation for correct use of client id, but dint help.
I am using the same client id that was used for v2, hope that should not create any problem.
Thanks for all the comments to my question, which made me to solve the problem. So, i thought of sharing the solution.
when i am not using the client id,
<script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
the response structure is
"overview_path": [{
"jb": 37.785610000000005,
"kb": -122.41127000000002
}, … ];
But, on using the client id, say gme-myClientId
<script src="https://maps.googleapis.com/maps/api/js?v=3&client=gme-myClientId&sensor=false" type="text/javascript"></script>
the response structure is
"overview_path": [{
"hb": 37.785610000000005,
"ib": -122.41127000000002
}, …];
So, variation in jb,kb to hb,ib was causing the problem, since i was using the variables as key to get the values.
I was using a third party Code which internally follows this procedure.
I mailed Google enterprise support and they replied me back saying i might be using some of the undocumented variables in my Javascript library. The variable names are automatically generated when the library is minified and can (and often do) change on every release they push. The correct way is to use the documented API methods only.
link for using documented API methods can be found
Here
i modified my code to use like the below
var latT = someLocationObject.lat();
var longT = someLocationObject.lng();
and it worked for me.
Well, to use a client id like "gme-XXXXX" you need to buy a Google Maps for Business licence. Have you already buy one ?
Regards,

Subgurim Maps control causing javascript errors ("GUnload undefined")

I want to implement a Google Map on my .NET page. I used the tool from Subgurim,
I could add the components well, but when browsing the page, I get tons of Javascript errors like:
GUnload is undefined
And the map is not shown. I read many posts describing my problem, but the only hint seems to be the maps API was not loaded.
I got a API key from Google. I am not very familiar with the interface; I activated both Google maps API services (v2 and v3) and got a key from "API access" for both separately.
I downloaded the Subgurim Maps version 3.4.1.
string streetAddress = "100 Russell St. Melbourne. VIC. 3000. Australia";
string mapKey = ConfigurationManager.AppSettings["googlemaps.subgurim.net"];
Subgurim.Controles.GeoCode geoCode = GMap1.getGeoCodeRequest(streetAddress, mapKey);
Subgurim.Controles.GLatLng gLatLng = new Subgurim.Controles.GLatLng(geoCode.Placemark.coordinates.lat, geoCode.Placemark.coordinates.lng);
GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal);
Subgurim.Controles.GMarker oMarker = new Subgurim.Controles.GMarker(gLatLng);
GMap1.addGMarker(oMarker);
Without access to your code, I deduce that you have included the Version 3 <script> tag but have coded the map in Version 2. Thus your code includes lots of G objects, including GUnload, which are not included in Version 3 and the API knows nothing about.
The immediate solution would be to include the Version 2 script. The full solution (since Version 2 is deprecated) is to convert the map to Version 3. I've no idea whether Subgurim makes that possible.
The new (short) key works for Version 3 and Version 2.
The problem was that the GMap control I used was in part of the page that was set visible="false". This caused the Javascript error.

Categories

Resources