This topic is locked
[SOLVED]

 Google maps integration

1/25/2018 7:59:19 AM
PHPRunner General questions
Y
YCH author

I am using PHPrunner 9.8 build 29725 x64
I am running my project on localhost.
I have this problem.

I inserted a simple google maps, as per adviced in the manual, in a List page.
I am using Latitude and Longitude coordinates for referencing. No geocoding needed.
On opening the List page, I can see the map with the markers hust a fraction of a second, then instantaneously the map is replaced by this error message.
Oops! Something went wrong.This page didn't load Google Maps correctly. See the Javascript console for technical details.

****

Javascript console is showing this :

unreachable code after return statement [Meer info] RunnerAll.js:38359:2

unreachable code after return statement [Meer info] RunnerAll.js:49785:2

unreachable code after return statement [Meer info] RunnerAll.js:53474:3

Google Maps API error: MissingKeyMapError https://developers.g...g-key-map-error

js:41:473

Google Maps API warning: NoApiKeys https://developers.g...ges#no-api-keys

util.js:248:12

Google Maps API warning: SensorNotRequired https://developers.g...or-not-required

util.js:248:12

unreachable code after return statement [Meer info] RunnerAll.js:38359:2

unreachable code after return statement [Meer info] RunnerAll.js:49785:2

unreachable code after return statement [Meer info] RunnerAll.js:53474:3

***
As per described in the manual no API key is needed ! Or did Google change her policy?

Is this known behaviour?

Y
YCH author 1/25/2018



https://stackoverflow.com/questions/37991340/error-google-maps-api-error-missingkeymaperror


@walk2fly

Thanks.

I have a API key now. It works well.
Additional question.

I am using the built-in Bootstrap style.

Any idea how I could make the map responsive too ?

HJB 1/25/2018

"responsive" refers to the pixel resolution the appliance is facing at the end of the gadget. Usually, I mean, before the newer smartphones and tablets with 1920 x 1080 resoltuion had been flooding the market, the main non-bootstrapped option to go was:
https://xlinesoft.com/phprunner/docs/mobile_template.htm
to cover whatsoever non-1080p displays of smartphones and else (lower than 1920 x 1080) pixels. What I would like to say is this: If your map ends up on a 1920 x 1080 display (e.g. smartphone) it should work fine like that. If lower pixel resolution would be ON, you would need to make a compromise in map size between PC monitor and else by sizing the map that way, it's not too small for the big display and not to big for the smaller displays with lower resolutions.
Or you run a MIX of bootstrapped and non-bootstrapped as mentioned above, informing the user by a linked button to choose from.
https://xlinesoft.com/phprunner/docs/choose_fields.htm
Finally, as another option to go, please check whether to can out the map into landscape mode, informing the user by small text message accordingly on how to view the map.

Y
YCH author 1/25/2018



"responsive" refers to the pixel resolution the appliance is facing at the end of the gadget. Usually, I mean, before the newer smartphones and tablets with 1920 x 1080 resoltuion had been flooding the market, the main non-bootstrapped option to go was:
https://xlinesoft.co...le_template.htm
to cover whatsoever non-1080p displays of smartphones and else (lower than 1920 x 1080) pixels. What I would like to say is this: If your map ends up on a 1920 x 1080 display (e.g. smartphone) it should work fine like that. If lower pixel resolution would be ON, you would need to make a compromise in map size between PC monitor and else by sizing the map that way, it's not too small for the big display and not to big for the smaller displays with lower resolutions.
Or you run a MIX of bootstrapped and non-bootstrapped as mentioned above, informing the user by a linked button to choose from.
https://xlinesoft.co...oose_fields.htm
Finally, as another option to go, please check whether to can out the map into landscape mode, informing the user by small text message accordingly on how to view the map.


Is something like here [url="https://bootsnipp.com/snippets/BaPj4"]https://bootsnipp.com/snippets/BaPj4[/url] possible ?
Wrapping the google map within a <div class="map-responsive">
and add additional CSS like :
.map-responsive{

overflow:hidden;

padding-bottom:56.25%;

position:relative;

height:0;

}

.map-responsive iframe{

left:0;

top:0;

height:100%;

width:100%;

position:absolute;

}
I tried this but without success.
May admin help ?

Y
YCH author 1/25/2018

Got it working now.
Added this to custom CSS :

mymapeventname_map {

height: 0;

width: 100%;

overflow: hidden;

padding-bottom: 50%;

padding-top: 30px;

position: relative;

}
and added this to the map event:
$mapSettings["width"] = '100%'; // instead of ... px

D
DealerModulesDevClub member 1/25/2018



Got it working now.
Added this to custom CSS :

mymapeventname_map {

height: 0;

width: 100%;

overflow: hidden;

padding-bottom: 50%;

padding-top: 30px;

position: relative;

}
and added this to the map event:
$mapSettings["width"] = '100%'; // instead of ... px


I ran into this as well a little while back and am glad to see you have it worked out. I would review your code and change out all "px" to "%, even your "padding-top: 30px" above. It will save you a lot of future edits.