0

I have added a marker in HERE map like below code.

hereMap.addMapObject(new MapMarker(new GeoCoordinate(lat, longi),setMapMarkerImage(R.drawable.zeroo)));

And with below code MapCircle not added in HERE map

MapCircle currentHereMapCircle = null;
currentHereMapCircle = new MapCircle(50.67,mm);
currentHereMapCircle.setRadius(50.67);
currentHereMapCircle.setFillColor(Color.CYAN);
currentHereMapCircle.setLineWidth(2);
currentHereMapCircle.setLineColor(Color.BLUE);
hereMap.addMapObject(currentHereMapCircle);`  

The app crashes when I add this code, any ideas why?

ᴘᴀɴᴀʏɪᴏᴛɪs
  • 7,169
  • 9
  • 50
  • 81
kushal
  • 156
  • 1
  • 9
  • post your error log. – Akash Patel Jan 02 '17 at 12:26
  • FATAL EXCEPTION: BaseTextureView-RenderThread Process: com.example.hereapi, PID: 6980 java.lang.NoClassDefFoundError: com.vividsolutions.jts.geom.Geometry at com.here.android.mpa.internal.ag.c(GLMapPolygonDrawable.java:141) at – kushal Jan 02 '17 at 13:14
  • after that i add this .jar file compile files('libs/jts-1.8.jar') then i got another error java.lang.NoSuchMethodError: com.vividsolutions.jts.geom.GeometryFactory.createPolygon at com.here.android.mpa.internal.ag.i(GLMapPolygonDrawable.java:186) – kushal Jan 02 '17 at 13:18
  • if your object **mm** is of `GeoCoordinate` and **hereMap** is of `com.here.android.mpa.mapping.Map` than your code is perfectly fine. i have tested with HERE SDK 3.3.0 – Akash Patel Jan 02 '17 at 13:27
  • yes **mm** is Geo Coordinate i am using .jar file only from here map SDK should i add HERE-sdk as module or lib ..? i just download new sdk and replace .jar file but got same error is this is right way to add new HERE-SDK ...? – kushal Jan 02 '17 at 13:43
  • No. New downloaded sdk has `.aar` file so delete JNI folder and old `.jar` file too. Add `.aar` file to libs folder and do like [this](http://stackoverflow.com/a/23326397/3425390). – Akash Patel Jan 02 '17 at 13:52
  • Is this the starter edition of the premium edition. JTS should NOT be mandatory for the premium edition. – David Leong Jan 03 '17 at 01:17
  • well i check that SDK folder but cant find .aar file my folder = HERE_Android_SDK_Starter_v3.3.0_30 in this folder i have ( HERE-sdk , copyright ,one .pdf) and in HERE-sdk folder (libs , tutorial , user-guide , progurd-here.sdk ).............. – kushal Jan 03 '17 at 04:06
  • @kushal I m using premium sdk. I dont know about starter sdk...so ask to David Leong. – Akash Patel Jan 03 '17 at 05:12
  • ops its working now with premium sdk Thanks @Akash Patel – kushal Jan 03 '17 at 09:20
  • welcome..... :) – Akash Patel Jan 03 '17 at 09:22

1 Answers1

0

This is a sample code that adds a MapCircle to a map:

MapCircle circle = new MapCircle(400.0, m_map.getCenter());
circle.setLineColor(Color.BLUE);
circle.setFillColor(Color.GRAY);
circle.setLineWidth(12);
m_map.addMapObject(circle);

Check the full implementation at: https://github.com/heremaps/here-android-sdk-examples/tree/master/map-objects

  • What is 400.0 value in MapCircle? Also is it in meters? Is it possible to drag and drop MapCircle in the map anyway? – Jay Mungara Jan 07 '21 at 12:03