Converting Flash Google Maps API to Javascript based in Flash? - javascript

I was given an older program to work on, and it uses the Google Maps API for Flash. The application is built in Flash CS5 and cannot be converted to anything else but Flash (as it's a piece of a larger Flex application that takes Flash built swfs and loads them into a Flex built larger application) so I can't use a pure Javascript approach. And also I don't know any Javascript, I'm basically a pure Flash/Flex developer, heh.
Is there an "easy" way to convert the application from the Flash based API to the Javascript based API? I don't even know where to start, I'm just out of college, this is my first real big project, and I'm the only Flash dev
Otherwise I'm kind of stuck, because the API key expired, Google doesn't give out new keys and they aren't answering my request to renew the key. I was also looking into the MapQuest Flash API and converting it over to that, however, I'm not sure.
I also want to note I can't use a web view, as content needs to be shown on top, and the entire map needs to be integrated into the SWF, I should only be pulling data from the API and displaying it in Flash as a Flash element. I've used a web set up before and it would not be appropriate for my needs for this project.

Converted the application to MapQuest's API. I was expecting a nightmare and I actually was very surprised at how smooth the transition went (as you can see by the time stamps). Didn't take me long at all.
Functionality is comparable, and it boiled down to just changing some function names to get the same functionality for simpler things, and then a bit of digging around and making everything work.

See my answer to the duplicate question: Embedding Google Maps in Flash - I have implemented Bing, Google and MapQuest JavaScript maps and their elevation services in Flash - the full post (with code) was too long so it is here: http://pastebin.com/Jzq5E06F

Related

Is there a Job-Searching API that I can implement in JavaScript? (like Indeed.com's API)

I'm looking for a job-searching API (sort of like Indeed.com's API) which can run oh HTML/JS. Preferably, it could locate the latitude and longitude of the jobs. It'd also be great if it were free, as this isn't a professional project.
I'm making a job-searching portal, which takes user's input and searches for jobs in a nearby radius. It then will return the data values back to the user. I have all the data I need, but I just need the API for locating such jobs.
Here's an example of what I was working with (before the API discontinued) :
https://rapidapi.com/indeed/api/indeed
I was originally planning on using Indeed.com's, but I found out it was discontinued and I am not able to find any more APIs, the ones that I find don't work (I'm using RapidAPI for searching for these APIs if that helps). If any of you know any such API, it would help a lot!

Implementing Google Translate In A Gulp AngularJS Application

I'm trying to find some information about how Google Translate works with an AngularJS web application. A little background information:
We're trying to offer a client a viable solution without prototyping something out. (The client may opt not to move forward with the translation functionality)
The translations don't have to be perfect. We're well aware of some of the issues with automated translations and that's perfectly fine for this client's need.
My concern really stems from the following:
An Angular application loads the text via async calls, so the text is rendered after the page loads. Will Google pick that up?
When we navigate to a new page, we're not really loading a new page. Again, will Google's translate widget pick that up?
Much of the content they want translated is user generated, so having translations created for each piece of text is not realistic.
Their current product was never intended for international audiences, so anything beyond Google Translate is going to be a decent sized retrofit.
Thoughts?
If you are using angular, or any other front end framework it would be simpler to use google's translate api directly.
After you fetch the content and before being rendered by the component you would want to async call their api and map the results.
Either that, or you could write a filter in angularjs to do the translating too, but you might end up with some jank as the text would change after render
https://docs.angularjs.org/api/ng/filter/filter
See: https://cloud.google.com/translate/docs/quickstart-client-libraries

google maps offline: not tiles but javascript

I have an HTML (phonegap) application that uses Google Maps API to display a map with markers. I want this app to be used offline. I know that Google Maps tiles can't be used offline (because of its license). However, what I want to do is use the map interface without the tiles.
When online -> tiles and markers displayed.
When offline -> only markers displayed.
However, the js loading of Google maps is complex, and I haven't managed to cache it.
Thanks.
Caching google maps javascript is not allowed, that's because their payment system is based on how many times their javascript API are loaded by the users. One page refresh is equal to one google maps API call, and depending what kind of contract you made you just lost -1 from the total amount of API requests you have purchased.
How is Google Maps API for Business usage tracked and reported?
A single load of the Google Maps JavaScript API into a page. The
JavaScript API is reloaded every time a page that uses the API is
reloaded. User interactions with the map (eg. panning, zooming,
changing map types) do not generate more page views. Note however that
a page view is generated if the API is loaded into the page even if
the API is not then used to display a map.
See https://developers.google.com/maps/documentation/business/faq#pageview
You could, of course contact google and try to ask some tailored business solution for your needs. I am not 100% sure what kind of things they offer if you contact them directly. But although, your request is somewhat impossible to fill since those UI generation codes also resides inside that google maps API javascript which you need.
So I would suggest that if you only need google maps interface when offline, take a moment and implement something similar with HTML/CSS/ (and some JS).. markers you could draw on canvas or use normal img's and positioning. If you need to implement dragging and zooming - it would be little bit more difficult but not impossible with canvas or some other techniques. But that being said it would just be easier to keep app online, we all have internet :) ? Making 1on1 matching dummy offline UI against google maps would be really painful process, when we consider the fact that google maps UI also changes overtime, like in their upcoming versions.
You could use OpenStreetMaps instead, it can be used offline: http://wiki.openstreetmap.org/wiki/Offline_Openstreetmap

Enable Youtube's JS API after the movie was loaded

I'm looking to control videos on my page, some of which may have not been embedded with the JavaScript API parameter on (enablejsapi) at first. They may come in both iframe or the old object embed types, though this shouldn't matter.
I looked around and none seem to be up to my standards, Enable YouTube API on existing player - his answer restarts the player (re-creates the element with apienabled)
I'm having a hard time with the documentation here https://developers.google.com/youtube/iframe_api_reference and https://developers.google.com/youtube/js_api_reference both seem to focus on irrelevant stuff. No technical details on how the API actually treats the elements so it's hard for me to guess where to go with this. Not the first time Google's JavaScript API is giving me hard time, certainly not the last
So I want to be able to control, or at least partially control (listen to play/stop events) players currently on the page which when were first embedded, did not request the API with them. Is there a way to enable the JavaScript API for them live? or hack the way to it?
Update: My progress so far surrounds re-creating the elements on the page with the API, the one technique I was trying so hard to avoid. I'm still facing all sorts of object/iframe api differences that's making me want to change my career so it will take a bit more polish. I will paste some coffee code when I figure everything out. It's nothing too fancy, but it's the only universal way to add a 'global listener', if you will, to a page full of existing embedded videos not necessarily with API enabled in them.
TLDR (Too Long Didn't Read): The Youtube API is imperfect.
As mentioned in the update, this question was solved by recreating the embed/iframe element. There isn't much magic here - just add the api variable to the URLs. Unfortunately I could not find a nicer way to enable it.

Choosing between YUI Charts or Google Visualization API

I'm a bit stuck with which charting library I will use in my project. Im stuck with this two (but also open for other suggestions)
For YUI Charts :
Pro :
- Very robust and configurable
Cons :
- Uses flash 9 >, which might potentially be inaccessible for users without up to date flash version
- Does not support export to image (for flash versions < 10 only)
For Google Visualization API
pros:
- small file size for the libraries,
- can be exported to static image charts (via separate API call)
Cons
- limited configuration options
So there, please help me decide. YUI charts has the edge over configuration options but Google Visualization API has the edge in terms of accessibility as it uses SVG to render the grapsh instead of Flash. For users that are hand-cuffed by corporate IT prohibitions , they cant just upgrade their Flash version and the page will not work.
Thanks!
I would choose Google's API as it requires only a javascript interpreter or internet access (to Google).
The fewer dependencies, the better. Not to mention there is quite an array of tools for manipulating SVG images.
If you really cannot make do without certain features in YUI or cannot find simpler ways to express your charts, then choose YUI.
You might also want to take a peek at http://www.simile-widgets.org/ It might be overkill / bad fit for your needs, but it is positively sexy.
If you don't want flash for drawing charts in your application it is better to choose
Google Visualization API...
The Google Visualization JavaScript API lets you access structured data and visualize that data using JavaScript in your web pages. The Google Visualization API also enables creation of gadgets.

Categories