Is it possible to draw charts with json data? - json

Is there any good article that gets me started with Google Visualization API which i ll be using in my application for drawing charts with JSON data. Any suggestion.
EDIT:
I was going through this question Iterating over json object for drawing a column chart?. This is what exactly i am trying to do? Any good ex?

Have you looked at Google's own page for the API? http://code.google.com/apis/visualization/documentation/gallery.html It has a lot of very good examples demonstrating different features.
If that's not enough, try the Chart Wizard that allows you to interactively build your chart data and then just copy the source code: http://imagecharteditor.appspot.com/ (for static image charts)
The navigation is a little confusing due to static vs. dynamic charts. Plus there are widgets, etc. But the examples and source code is there, so just look carefully around.

Related

How do I retrieve text and images from websites (in HTML or JSON) on iOS Swift?

I looked around the Internet to figure out how to get data from websites using SWIFT, and have narrowed it down to roughly JSON or HTML, which I am not familiar with.
As far as I know, there are third party libraries for me to use to parse the data. I have been following Dani Arnaout’s Working with JSON in Swift Tutorial as a reference. However, I have not been able to find the way to retrieve the JSON from any random website. Only the iTunes JSON page, which is included in the tutorial, works.
What I want to do: Make an app that downloads images and also some text from many different websites, either by HTML or JSON. The problem right now is that I have no idea how to start doing it. A simple demo would be helpful.
Questions
How do I get the JSON of any random website on the Internet?
How do I make use of the HTML data from websites to turn it into a readable format? I’m retrieving the HTML using Google Chrome, and it seems to be gibberish: I can’t find the text anywhere.
Question 1: Not all websites expose their content formatted as JSON.
Question 2: I think you should look at a couple of resources. First Ray Wenderlich has a tutorial on how to parse HTML. Although it is using Objective-C you should be able to learn quite a lot there.
When you have read that tutorial I would recommend you look at the Swift library Alamofire. There is another tutorial on the Wenderlich site covering this library.
Happy coding!

How do you make geojson data for a custom google map

I think the question says it all, I have a custom google map and want to put some geojason shapes on it.
In an ideal world scan them from a sheet of paper perhaps using a pre existant image.
Just looking and gimp might be a way forward.
Still though I'll leave this question open as might be useful for others.
Richard
The simplest way is to use the Data layer Look at the example in google maps api.
Basically, you use the loadGeoJson method and pass it a valid geojson file's url
map.data.loadGeoJson('https://storage.googleapis.com/maps-devrel/google.json');
This means that, whatever shapes you have already drawn in another source will have to be converted to geoJson format.
There are a lot of converters that can translate from-to KML, SHP, WKT, GPX and geoJson, but you still need to get from plain images to one of those formats.
In the end I ripped some code out from here.
http://blog.sallarp.com/geojson-google-maps-editor.html
Applied to my own map and got the coordinates that I needed and then had to play around with the json job done.
Feel that there should have been a program that made this all easier but can't have it all!
Richard

How to parse a PDF using AS3? (air)

is there a way to parse a pdf using AS3 via Air in mobile?.
I don't need the full content of the PDF, only some data, is that possible?.
Edit for clarification:
I got a PDF file that was originally created based on a XML, what I'd need is to be able to retrieve that XML. Or at least, to find a string inside that PDF so I can make a call to a web service.
Original:
There's nothing native in AS3 for this kind of stuff but AlivePDF. It won't let you traverse things like XML so much, as it seems like you're trying to do by taking a small bit of a PDF, but it will let you create pdf's, add pages and change fonts etc.
You weren't entirely clear on what you're attempting to achieve, if you update your question a with a bit more detail we may be able to help a bit more.
Edit:
From the refined question, AlivePDF is not what you're after as it's really only for PDF generation. I'm assuming you're after a method to traverse the document like you would XML, by looking for a tag and extracting the information. I've not found a way to do this other than iterating through the document and searching manually which probably isn't what you're after.
After some searching I found an as3-pdfreader which doesn't seem to be complete at the moment. However on the Project Home the roadmap says parsing pdf files is complete, I've not been able to try it out yet though.

Preferred layer to create track (line) on openlayers

Currently using openlayers as map ui on my web app. The problem is i confused with many different layer type supported on Openlayers (which mean good btw). So anyone can suggest a suitable layer for this?
My goal is simple, i just want to create a layer which contain line as "tracking line" (let's call it "track") like what we can see here:
OpenStreetMaps Example
Right now currently using PointTrack and GeoRSS to display the track layer, also i have considered using KML layer now since it more versatile.
The consideration to take:
It must be fast enough to render on all browsers (especially IE8)
It loads data from other source (such as kml or xml file)
Refreshable
Styleable (size,color,etc)
PS: attach a sample if available
I would prefer to use OpenLayers.Layer.Vector in this situation. It's very flexible when it comes to styling features and you have full control over the contents of the layer(refreshable).
It doesn't matter in what format you have your data as you can read many different formats with OpenLayers.Format.* classes. So you use whatever format you need to create features and add then add them to you Vector layer.
How fast it renders data depends on how much data you have. IE tends to perform poorly when you throw a lot of vector data to the map.
You can see basic example here
EDIT: If you need to display a lot of data on a map then you probably would consider using WMS layer.
There is similar problem and solution to it described here.
Your data is rendered on server and is sent to the client as an image. You loose some flexibility comparing when you do everything on the client though.

Which map api would best support fictionally defined maps?

I am researching the feasibility of setting up a mapping tool for my alliance in an online game.
The game is not based in the real world so I am not interested in the content of the map tools available, just the functionality.
Minimally, I would like the map to display information about where allied cities are located in the world. Ideally, I'd like to be able to display information about desired trades, levels of development, and military actions. All this should be editable by the map users.
I've been looking at the google maps API and it appears that I could use it to serve my ends by using my own map tiles with a custom defined map object and some custom overlays, but it looks like it would be a lot of work to set up.
Is there another tool that would be better suited to this task?
A List Apart has an article from the creators of EveryBlock.com. They use a full open-source stack (client side library, tile cache, map generator) as an alternative to Google Maps. That sounds like it has exactly what you need.
I would argue that the Goole Maps API approach is not as difficult as you imagine. The API provides a very nice interface to define custom tilesets to render your own maps.
This interface is actually quite simple to use. There is a detailed description of it here. When you create a GMapType object you can specify a vector of urls to your own image tiles, label images and fundamentally change the display paradigm.
There are quite a few examples of this on the web:
George R R Martin's Game of Thrones. I found the javascript they have written pretty clear.
The Oblivion Gameworld (as Matt mentioned).
World of Warcraft Gameworld
I reckon this is a really powerful way of implementing your own maps on the web.
There is a google map implementation of the Oblivion gameworld - this might serve as a reference.
Wouldn't defining your own overlay with a KMZ file in Google Maps work?