Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 66

Patrickmotox
Aspiring developer
Profile
Posts: 89
Reg: Dec 10, 2013
Cameron Park, C...
7,090
01/31/14 06:28 PM (11 years ago)

Location Map

where is the singleLocationDefaultZoom being set for android in BT_screen_map.java? All I find is this, with no action taking place. I can change the single point location number in Buzztouch console,and nothing happens. led me to find this in the code. In doing a search, I find only these two lines. Nothing is being done with them in the code...?????? set variable public String singleLocationDefaultZoom = ""; get the number from Json singleLocationDefaultZoom = BT_strings.getJsonPropertyValue(this.screenData.getJsonObject(), "singleLocationDefaultZoom", ""); <------ Ok we got the number, right? Now, don't we do something with it????? Help....
 
Patrickmotox
Aspiring developer
Profile
Posts: 89
Reg: Dec 10, 2013
Cameron Park, C...
7,090
like
02/01/14 12:54 PM (11 years ago)
Nothing? This plugin has been out how long and ?????? Hmmm..Nobody has used it in Android with a single point and wanted to set the zoom and come across this issue????
 
Patrickmotox
Aspiring developer
Profile
Posts: 89
Reg: Dec 10, 2013
Cameron Park, C...
7,090
like
02/01/14 03:34 PM (11 years ago)
Never mind. Figured it out with help from Google. ":^)
 
Patrickmotox
Aspiring developer
Profile
Posts: 89
Reg: Dec 10, 2013
Cameron Park, C...
7,090
like
02/02/14 12:40 PM (11 years ago)
Here is what I had to do for android single point zoom in the screen_map.java and on onResume, call it, zoominin(); I didn't do anything with the catch blocks but it works great. Just put in the zoom number you need in the line CameraUpdateFactory.newLatLngZoom(latLng, 15); Don't know how clean or efficient this is, but it works. //zoom in public void zoominin(){ BT_debugger.showIt(fragmentName); String theJSONString = ""; JSONArray items = null; if(theJSONString.length() < 1){ if(this.screenData.getJsonObject().has("childItems")){ try { items = this.screenData.getJsonObject().getJSONArray("childItems"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }else{ JSONObject raw = null; try { raw = new JSONObject(theJSONString); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(raw.has("childItems")){ try { items = raw.getJSONArray("childItems"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } //loop items.. if(items != null){ for (int i = 0; i < items.length(); i++){ JSONObject tmpJson = null; try { tmpJson = items.getJSONObject(i); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } BT_item tmpItem = new BT_item(); if(tmpJson.has("itemId")) try { tmpItem.setItemId(tmpJson.getString("itemId")); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(tmpJson.has("itemType")) try { tmpItem.setItemType(tmpJson.getString("itemType")); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } //check for valid entries in a minute... String tmpLatitude1 = ""; String tmpLongitude1 = ""; //latitude... if(tmpJson.has("latitude")) { try { tmpLatitude1 = tmpJson.getString("latitude"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if(tmpJson.has("longitude")){ try { tmpLongitude1 = tmpJson.getString("longitude"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } //remember it only if we have location... // tmpLatitude1 = tmpJson.getString("latitude"); // tmpLongitude1 = tmpJson.getString("longitude"); LatLng latLng; if(tmpLatitude1.length() > 4 && tmpLongitude1.length() > 4){ latLng = new LatLng(Double.parseDouble(tmpLatitude1), Double.parseDouble(tmpLongitude1)); CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 15); mapView.animateCamera(cameraUpdate);} } } }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/03/14 09:34 AM (11 years ago)
Thanks for letting us know of your solution. Tell us when your fantastic app is released! :-)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.