user3620503
user3620503

Reputation: 11

Google maps engine Lite API script failing

The code is as follows:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.whitemetro.typeandcache.TypeandCache"
    tools:ignore="MergeRootFrame" />
<script type="text/javascript"
  src="http://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=false">
    </script>
var layer = new google.maps.visualization.MapsEngineLayer(Original Type and Caches);
var layer = new google.maps.visualization.MapsEngineLayer(Basic Type And Caches);
var layer = new google.maps.visualization.MapsEngineLayer(Type And Cache-Geocache Hybrids);

It returns errors like this:

The markup in the document following the root element must be well-formed.

Unexpected text found in layout file:

"var layer = new google.maps.visualization.MapsEngineLayer(Original Type and Caches);var layer = ne..."

Sorry if I am not literate with android as I have just started with it

Upvotes: 1

Views: 279

Answers (1)

Mark McDonald
Mark McDonald

Reputation: 8190

It looks as though you're embedding HTML / JavaScript code from the JavaScript Maps Engine Layer API example into an Android layout. They are different languages & platforms and therefore cannot be mixed.

In order to embed a Maps Engine map into a mobile app, you need to be using the platform edition of Maps Engine, not the Lite or Pro editions. There is a Maps Engine Layer for Android available for enterprise (paid) customers, or if you're using the free edition you can use the API to query your table data and use the standard Android Maps v2 API to render it.

Upvotes: 1

Related Questions